class: center, middle, inverse, title-slide #
Multi-level Model Research Questions
## Data Analysis for Psychology in R 3 ### Josiah King ### Department of Psychology
The University of Edinburgh ### AY 2021-2022 --- class: inverse, center, middle <h2>Part 1: Model Specification</h2> <h2 style="text-align: left;opacity:0.3;">Part 2: Analysis</h2> <h2 style="text-align: left;opacity:0.3;">Part 3: Reporting</h2> --- class: center, middle # How do we get from research questions and study design to model specification? --- # Study In 2010 A US state's commissioner for education approved the trialing of an intervention in which yearly Parent Management Training (PMT) group sessions were offered to the parents of a cohort of students entering 10 different high schools. Every year, the parents were asked to fill out an informant-based version of the Aggressive Behaviour Scale (ABS), measuring verbal and physical abuse, socially inappropriate behavior, and resisting care. Where possible, the same parents were followed up throughout the child's progression through high school. Alongside this, parents from a cohort of students entering 10 further high schools in the state were recruited to also complete the same informant-based ABS, but were not offered the PMT group sessions. 1. How does the presentation of aggressive behaviours change with age? 2. Is there any evidence for the efficacy of Parent Management Training (PMT) group sessions in reducing levels of adolescent aggression? The data is available at https://uoepsy.github.io/data/abs_intervention.csv --- # Data <table> <thead> <tr> <th style="text-align:left;"> variable </th> <th style="text-align:left;"> description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> schoolid </td> <td style="text-align:left;"> Name of school </td> </tr> <tr> <td style="text-align:left;"> ppt </td> <td style="text-align:left;"> Participant number </td> </tr> <tr> <td style="text-align:left;"> age </td> <td style="text-align:left;"> Age of participant (in years) at observation </td> </tr> <tr> <td style="text-align:left;"> ABS </td> <td style="text-align:left;"> Informant-based Aggressive Behaviour Scale (ABS) score (range 0 to 100) </td> </tr> <tr> <td style="text-align:left;"> interv </td> <td style="text-align:left;"> Whether or not the school was part of the intervention group in which Parent Management Training (PMT) group sessions were offered to the parents </td> </tr> </tbody> </table> ```r absint<-read_csv("https://uoepsy.github.io/data//abs_intervention.csv") %>% mutate(interv=factor(interv)) head(absint) ``` ``` ## # A tibble: 6 × 5 ## schoolid ppt age ABS interv ## <chr> <dbl> <dbl> <dbl> <fct> ## 1 Blue River High School 1 12 64.9 1 ## 2 Blue River High School 1 13 54.7 1 ## 3 Blue River High School 1 14 45.7 1 ## 4 Blue River High School 1 15 48.9 1 ## 5 Blue River High School 1 16 39.0 1 ## 6 Blue River High School 1 17 32.3 1 ``` --- # Outcome and Fixed Effects .br2.f4.gray.bg-white[ (g)lmer(**outcome** ~ fixed effects + (random effects | grouping structure), family = error distribution) ] .pull-left[ - What are we interested in explaining/predicting? ] -- .pull-right[ > **Research Questions** > 1. How does the presentation of aggressive behaviours change with age? >2. Is there any evidence for the efficacy of Parent Management Training (PMT) group sessions in reducing levels of adolescent aggression? ] --- count:false # Outcome and Fixed Effects .br2.f4.gray.bg-white[ **(g)lmer**(outcome ~ fixed effects + (random effects | grouping structure), **family = error distribution**) ] .pull-left[ - What are we interested in explaining/predicting? - How is this measured? ] .pull-right[ > **Research Questions** > 1. How does the presentation of aggressive behaviours change with age? >2. Is there any evidence for the efficacy of Parent Management Training (PMT) group sessions in reducing levels of adolescent aggression? ```r ggplot(absint, aes(x=ABS))+ geom_histogram() + themedapr3() ``` ![](05_mlmresearch_files/figure-html/unnamed-chunk-3-1.png)<!-- --> ] --- count:false # Outcome and Fixed Effects .br2.f4.gray.bg-white[ (g)lmer(outcome ~ **fixed effects** + (random effects | grouping structure), family = error distribution) ] .pull-left[ - What are we interested in explaining/predicting? - How is this measured? - What variables are we interested in explaining this by? ] .pull-right[ > **Research Questions** > 1. How does the presentation of aggressive behaviours change with age? >2. Is there any evidence for the efficacy of Parent Management Training (PMT) group sessions in reducing levels of adolescent aggression? <table> <thead> <tr> <th style="text-align:left;"> schoolid </th> <th style="text-align:left;"> ppt </th> <th style="text-align:left;"> age </th> <th style="text-align:left;"> ABS </th> <th style="text-align:left;"> interv </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 12 </td> <td style="text-align:left;"> 64.9 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 13 </td> <td style="text-align:left;"> 54.7 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 14 </td> <td style="text-align:left;"> 45.7 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 15 </td> <td style="text-align:left;"> 48.9 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> NA </td> </tr> </tbody> </table> ] --- # Within & Between Effects .br2.f4.gray.bg-white[ (g)lmer(outcome ~ **fixed effects** + (random effects | grouping structure), family = error distribution) ] .pull-left[ - Are our questions about the effects of our predictors specifically in reference to _group means_ of predictors? - "the effect of being higher on `\(x\)` *__for a__* group" - "the effect of a group being *__on average__* higher on `\(x\)`" ] -- .pull-right[ > **Research Questions** > 1. How does the presentation of aggressive behaviours change with age? >2. Is there any evidence for the efficacy of Parent Management Training (PMT) group sessions in reducing levels of adolescent aggression? ] --- # The Grouping Structure .br2.f4.gray.bg-white[ (g)lmer(outcome ~ fixed effects + (random effects | grouping structure), family = error distribution) ] .pull-left[ - In what different ways can we group our data? ] -- .pull-right[ ```r nrow(absint) ``` ``` ## [1] 1528 ``` ```r absint %>% mutate(schoolppt = interaction(schoolid,ppt)) %>% summarise(across(everything(), n_distinct)) ``` ``` ## # A tibble: 1 × 6 ## schoolid ppt age ABS interv schoolppt ## <int> <int> <int> <int> <int> <int> ## 1 20 14 8 985 2 191 ``` ] ??? when should my variable be a "fixed effect" and when should it be the "group"? --- # The Grouping Structure .br2.f4.gray.bg-white[ (g)lmer(outcome ~ fixed effects + (random effects | grouping structure), family = error distribution) ] .pull-left[ - In what different ways can we group our data? - Of the different ways we can group our data, which groupings are of specific inferential interest? - Of the different ways we can group our data, which groupings do we think of as a random sample from a general population of groups? ] .pull-right[ > **Research Questions** > 1. How does the presentation of aggressive behaviours change with age? >2. Is there any evidence for the efficacy of Parent Management Training (PMT) group sessions in reducing levels of adolescent aggression? <table> <thead> <tr> <th style="text-align:left;"> schoolid </th> <th style="text-align:left;"> ppt </th> <th style="text-align:left;"> age </th> <th style="text-align:left;"> ABS </th> <th style="text-align:left;"> interv </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 12 </td> <td style="text-align:left;"> 64.9 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 13 </td> <td style="text-align:left;"> 54.7 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 14 </td> <td style="text-align:left;"> 45.7 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 15 </td> <td style="text-align:left;"> 48.9 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> NA </td> </tr> </tbody> </table> ] ??? when should my variable be a "fixed effect" and when should it be the "group"? --- count:false # The Grouping Structure .br2.f4.gray.bg-white[ (g)lmer(outcome ~ **fixed effects** + (random effects | grouping structure), family = error distribution) ] .pull-left[ - In what different ways can we group our data? - **Of the different ways we can group our data, which groupings are of specific inferential interest?** - Of the different ways we can group our data, which groupings do we think of as a random sample from a general population of groups? ] .pull-right[ > **Research Questions** > 1. How does the presentation of aggressive behaviours change with age? >2. Is there any evidence for the efficacy of Parent Management Training (PMT) group sessions in reducing levels of adolescent aggression? <table> <thead> <tr> <th style="text-align:left;"> schoolid </th> <th style="text-align:left;"> ppt </th> <th style="text-align:left;"> age </th> <th style="text-align:left;"> ABS </th> <th style="text-align:left;"> interv </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 12 </td> <td style="text-align:left;"> 64.9 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 13 </td> <td style="text-align:left;"> 54.7 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 14 </td> <td style="text-align:left;"> 45.7 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 15 </td> <td style="text-align:left;"> 48.9 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> NA </td> </tr> </tbody> </table> ] ??? when should my variable be a "fixed effect" and when should it be the "group"? --- count:false # The Grouping Structure .br2.f4.gray.bg-white[ (g)lmer(outcome ~ fixed effects + (random effects | **grouping structure**), family = error distribution) ] .pull-left[ - In what different ways can we group our data? - Of the different ways we can group our data, which groupings are of specific inferential interest? - **Of the different ways we can group our data, which groupings do we think of as a random sample from a general population of groups?** ] .pull-right[ > **Research Questions** > 1. How does the presentation of aggressive behaviours change with age? >2. Is there any evidence for the efficacy of Parent Management Training (PMT) group sessions in reducing levels of adolescent aggression? <table> <thead> <tr> <th style="text-align:left;"> schoolid </th> <th style="text-align:left;"> ppt </th> <th style="text-align:left;"> age </th> <th style="text-align:left;"> ABS </th> <th style="text-align:left;"> interv </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 12 </td> <td style="text-align:left;"> 64.9 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 13 </td> <td style="text-align:left;"> 54.7 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 14 </td> <td style="text-align:left;"> 45.7 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 15 </td> <td style="text-align:left;"> 48.9 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> NA </td> </tr> </tbody> </table> ] ??? when should my variable be a "fixed effect" and when should it be the "group"? --- # The Grouping Structure .br2.f4.gray.bg-white[ (g)lmer(outcome ~ fixed effects + (random effects | **grouping structure**), family = error distribution) ] .pull-left[ - In what different ways can we group our data? - Of the different ways we can group our data, which groupings are of specific inferential interest? - Of the different ways we can group our data, which groupings do we think of as a random sample from a general population of groups? - Is there more than one grouping of this sort, and if so, are these groupings nested? Are the labels unique? - For each level, how many groups have we sampled? ] -- .pull-right[ ```r table(absint$schoolid, absint$ppt) ``` ``` ## ## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ## Blue River High School 8 8 8 8 8 8 8 8 0 0 0 0 0 0 ## Central Grammar School 8 8 8 8 8 8 8 8 8 8 8 0 0 0 ## Central High 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ## Clearwater Charter School 8 8 8 8 8 8 8 8 8 8 8 0 0 0 ## Clearwater School of Fine Arts 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ## Coral Coast Institute 8 8 8 8 8 8 8 8 8 0 0 0 0 0 ## Eagle Mountain Technical School 8 8 8 8 8 8 8 8 8 0 0 0 0 0 ## Eastwood Institute 8 8 8 8 8 8 8 8 0 0 0 0 0 0 ## Edgewood Grammar School 8 8 8 8 8 8 8 8 0 0 0 0 0 0 ## Elk Grove School 8 8 8 8 8 8 8 0 0 0 0 0 0 0 ## Grand Mountain Elementary 8 8 8 8 8 8 8 8 0 0 0 0 0 0 ## Horizon Elementary 8 8 8 8 8 8 8 8 8 0 0 0 0 0 ## Liberty High 8 8 8 8 8 8 8 8 8 8 8 0 0 0 ## Long Beach School 8 8 8 8 8 8 8 8 8 8 8 8 0 0 ## Oak Park Technical School 8 8 8 8 8 8 0 0 0 0 0 0 0 0 ## Seal Bay Middle School 8 8 8 8 8 8 8 8 8 8 0 0 0 0 ## South Fork Conservatory 8 8 8 8 8 8 8 8 8 8 8 0 0 0 ## Tranquillity Elementary 8 8 8 8 8 8 8 0 0 0 0 0 0 0 ## Tranquillity Middle School 8 8 8 8 8 8 8 8 0 0 0 0 0 0 ## Woodside University 8 8 8 8 8 8 8 8 8 8 0 0 0 0 ``` ] ??? when should my variable be a "fixed effect" and when should it be the "group"? --- # Random Intercepts and Slopes .br2.f4.gray.bg-white[ (g)lmer(outcome ~ fixed effects + (**random effects** | grouping structure), family = error distribution) ] .pull-left[ - Which of our fixed effects can vary for our random groups? - "does a single group have multiple values for `\(x\)`?" - "for the data from only one of our groups, can we estimate `\(y \sim x\)`?" ] -- .pull-right[ All the data: ![](05_mlmresearch_files/figure-html/unnamed-chunk-10-1.png)<!-- --> Data from School == "Central High": ![](05_mlmresearch_files/figure-html/unnamed-chunk-11-1.png)<!-- --> ] ??? 2. when should my variable be a "fixed effect" and when should it be a "random effect" by some group? --- # Random Intercepts and Slopes .br2.f4.gray.bg-white[ (g)lmer(outcome ~ fixed effects + (**random effects** | grouping structure), family = error distribution) ] .pull-left[ - Which of our fixed effects can vary for our random groups? - "does a single group have multiple values for `\(x\)`?" - "for the data from only one of our groups, can we estimate `\(y \sim x\)`?" ] .pull-right[ All the data: ![](05_mlmresearch_files/figure-html/unnamed-chunk-12-1.png)<!-- --> Data from School == "Central High", Participant == "1": ![](05_mlmresearch_files/figure-html/unnamed-chunk-13-1.png)<!-- --> ] ??? 2. when should my variable be a "fixed effect" and when should it be a "random effect" by some group? --- # Our model .br2.f4.gray.bg-white[ (g)lmer(outcome ~ fixed effects + (random effects | grouping structure), family = error distribution) ] -- .br2.f4.green.bg-white[ lmer(ABS ~ age_c * interv + (1 + age_c | schoolid / ppt ) ] .pull-left[ <table> <thead> <tr> <th style="text-align:left;"> schoolid </th> <th style="text-align:left;"> ppt </th> <th style="text-align:left;"> age </th> <th style="text-align:left;"> ABS </th> <th style="text-align:left;"> interv </th> <th style="text-align:left;"> age_c </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 12 </td> <td style="text-align:left;"> 64.9 </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 0 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 13 </td> <td style="text-align:left;"> 54.7 </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 14 </td> <td style="text-align:left;"> 45.7 </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 2 </td> </tr> <tr> <td style="text-align:left;"> Blue River High School </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 15 </td> <td style="text-align:left;"> 48.9 </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 3 </td> </tr> <tr> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> ... </td> <td style="text-align:left;"> NA </td> <td style="text-align:left;"> ... </td> </tr> </tbody> </table> ] --- class: inverse, center, middle <h2 style="text-align: left;opacity:0.3;">Part 1: Model Specification</h2> <h2>Part 2: Analysis</h2> <h2 style="text-align: left;opacity:0.3;">Part 3: Reporting</h2> --- # Model issues - Convergence issues. ```r absmod <- lmer(ABS ~ age_c * interv + (1 + age_c | schoolid/ppt), data = absint, control = lmerControl(optimizer="bobyqa"), REML = TRUE) ``` ``` ## [1] "Normal exit from bobyqa" ``` -- - Check assumptions have been met -- ![](05_mlmresearch_files/figure-html/unnamed-chunk-18-1.png)<!-- --> --- # Model issues - Convergence issues. ```r absmod <- lmer(ABS ~ age_c * interv + (1 + age_c | schoolid/ppt), data = absint, control = lmerControl(optimizer="bobyqa"), REML = TRUE) ``` ``` ## [1] "Normal exit from bobyqa" ``` - Check assumptions have been met .pull-left[ ![](05_mlmresearch_files/figure-html/unnamed-chunk-21-1.png)<!-- --> ] .pull-right[ ![](05_mlmresearch_files/figure-html/unnamed-chunk-22-1.png)<!-- --> ] --- # Model issues - Convergence issues. ```r absmod <- lmer(ABS ~ age_c * interv + (1 + age_c | schoolid/ppt), data = absint, control = lmerControl(optimizer="bobyqa"), REML = TRUE) ``` ``` ## [1] "Normal exit from bobyqa" ``` - Check assumptions have been met ``` ## [1] "Shapiro-Wilk normality test resid(absmod) W=1, p=0.52" ## [2] "Shapiro-Wilk normality test ranef(absmod)$schoolid$`(Intercept)` W=0.91, p=0.06" ## [3] "Shapiro-Wilk normality test ranef(absmod)$schoolid$age_c W=0.93, p=0.13" ## [4] "Shapiro-Wilk normality test ranef(absmod)$ppt$`(Intercept)` W=0.99, p=0.26" ## [5] "Shapiro-Wilk normality test ranef(absmod)$ppt$age_c W=0.99, p=0.25" ``` --- # Model issues - Convergence issues. ```r absmod <- lmer(ABS ~ age_c * interv + (1 + age_c | schoolid/ppt), data = absint, control = lmerControl(optimizer="bobyqa"), REML = TRUE) ``` ``` ## [1] "Normal exit from bobyqa" ``` - Check assumptions have been met ![](05_mlmresearch_files/figure-html/unnamed-chunk-28-1.png)<!-- --> --- # Inference .pull-left[ ## Tests - Model comparison - Parameter estimates ] .pull-right[ ## Methods - df approximations - Likelihood Ratio Tests `anova(model1, model2, ...)` - Bootstrap - parametric bootstrap `pbkrtest::PBmodcomp()` and `confint(method="boot")` - case bootstrap `lmeresampler::bootstrap(model, type = "case", resample = c(....))` ] --- # Inference ```r absmod <- lmer(ABS ~ age_c * interv + (1 + age_c | schoolid/ppt), data = absint, control = lmerControl(optimizer="bobyqa"), REML = TRUE) ``` ```r library(lmeresampler) absmodBS <- bootstrap(absmod, .f=fixef, type = "case", B = 2000, resample = c(FALSE,TRUE,FALSE)) confint(absmodBS, type="perc") ``` ``` ## # A tibble: 4 × 6 ## term estimate lower upper type level ## <chr> <dbl> <dbl> <dbl> <chr> <dbl> ## 1 (Intercept) 50.5 49.2 51.8 perc 0.95 ## 2 age_c 0.633 -0.0642 1.27 perc 0.95 ## 3 interv -0.295 -2.13 1.37 perc 0.95 ## 4 age_c:interv -1.71 -2.54 -0.790 perc 0.95 ``` --- class: inverse, center, middle <h2 style="text-align: left;opacity:0.3;">Part 1: Model Specification</h2> <h2 style="text-align: left;opacity:0.3;">Part 2: Analysis</h2> <h2>Part 3: Reporting</h2> --- # Reporting the analysis process - Data cleaning outlier/data removal, transformations _prior to_ analysis. - Unplanned transformations and data removal which are carried out in order to meet assumptions. -- - Specify all fixed effects (explanatory variables & covariates). Link them to explicitly stated research questions/hypotheses. - Explicitly state the hierarchical structure of the data and of the model. Specify random effects according to the sampling units (schools/children etc) with which they interact. -- - State the software packages and versions used to fit the model(s), along with the estimation method (ML/REML) and optimiser used. - If a proposed model fails to converge, clearly specify the procedure used to obtain converging model. -- - State clearly the relevant test/comparison/parameter estimate of interest. Link to explicitly stated research questions/hypotheses. - Any model comparisons should be clearly stated so that the reader understands the structure of both models being compared. - Specify the method you plan to use to conduct inference (e.g. LRT, bootstrap) --- # Reporting results from the model(s) .pull-left[ Information to include: - all parameter estimates for fixed effects. - coefficients - standard errors and/or confidence intervals - associated test statistics and p-values (if used) {{content}} ] -- - random effects - standard deviation and/or variance for each random effect - correlations/covariances if modelled - residual variance/standard deviation {{content}} -- - some measure of model fit (marginal/conditional `\(R^2\)`) --- count:false # Reporting results from the model(s) .pull-left[ Information to include: - all parameter estimates for fixed effects. - coefficients - standard errors and/or confidence intervals - associated test statistics and p-values (if used) - random effects - standard deviation and/or variance for each random effect - correlations/covariances if modelled - residual variance/standard deviation - some measure of model fit (marginal/conditional `\(R^2\)`) <br> `sjPlot::tab_model()` gets you a lot of the way there! ] .pull-right[ <small> <table style="border-collapse:collapse; border:none;"> <tr> <th style="border-top: double; text-align:center; font-style:normal; font-weight:bold; padding:0.2cm; text-align:left; "> </th> <th colspan="2" style="border-top: double; text-align:center; font-style:normal; font-weight:bold; padding:0.2cm; ">ABS</th> </tr> <tr> <td style=" text-align:center; border-bottom:1px solid; font-style:italic; font-weight:normal; text-align:left; ">Predictors</td> <td style=" text-align:center; border-bottom:1px solid; font-style:italic; font-weight:normal; ">Estimates</td> <td style=" text-align:center; border-bottom:1px solid; font-style:italic; font-weight:normal; ">CI</td> </tr> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; ">(Intercept)</td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:center; ">50.45</td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:center; ">48.07 – 52.84</td> </tr> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; ">age_c</td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:center; ">0.63</td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:center; ">-0.32 – 1.59</td> </tr> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; ">interv [1]</td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:center; ">-0.30</td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:center; ">-3.69 – 3.10</td> </tr> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; ">age_c * interv [1]</td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:center; ">-1.71</td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:center; ">-3.07 – -0.35</td> </tr> <tr> <td colspan="3" style="font-weight:bold; text-align:left; padding-top:.8em;">Random Effects</td> </tr> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">σ<sup>2</sup></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">79.79</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">τ<sub>00</sub> <sub>ppt:schoolid</sub></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">19.27</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">τ<sub>00</sub> <sub>schoolid</sub></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">8.10</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">τ<sub>11</sub> <sub>ppt:schoolid.age_c</sub></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">7.81</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">τ<sub>11</sub> <sub>schoolid.age_c</sub></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">0.79</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">ρ<sub>01</sub> <sub>ppt:schoolid</sub></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">0.93</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">ρ<sub>01</sub> <sub>schoolid</sub></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">0.68</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">ICC</td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">0.65</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">N <sub>ppt</sub></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">14</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm;">N <sub>schoolid</sub></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left;" colspan="2">20</td> <tr> <td style=" padding:0.2cm; text-align:left; vertical-align:top; text-align:left; padding-top:0.1cm; padding-bottom:0.1cm; border-top:1px solid;">Marginal R<sup>2</sup> / Conditional R<sup>2</sup></td> <td style=" padding:0.2cm; text-align:left; vertical-align:top; padding-top:0.1cm; padding-bottom:0.1cm; text-align:left; border-top:1px solid;" colspan="2">0.026 / 0.659</td> </tr> </table> </small> ] --- # Visualising the model(s) - Think about your questions .pull-left[ ![](05_mlmresearch_files/figure-html/unnamed-chunk-33-1.png)<!-- --> ] .pull-right[ > **Research Questions** > 1. How does the presentation of aggressive behaviours change with age? >2. Is there any evidence for the efficacy of Parent Management Training (PMT) group sessions in reducing levels of adolescent aggression? ] --- # Visualising the model(s) .pull-left[ There's always `sjPlot::plot_model()`! ![](05_mlmresearch_files/figure-html/unnamed-chunk-34-1.png)<!-- --> ] -- .pull-right[ But plotting manually gives you more control: ![](05_mlmresearch_files/figure-html/unnamed-chunk-35-1.png)<!-- --> ] --- class: inverse, center, middle, animated, rotateInDownLeft # End ## Thanks for listening!