Mixed-effects modelling in 6 weeks
Overall objective
To understand key concepts in building mixed-effects models
To test the understanding with the data of the priming study
Weekly Objectives
Week 0: How to use R project and how to input the dataset
Week 1: When to use mixed-effects modelling or multilevel modelling (MLM), as opposed to traditional multiple regression
Week 2: Selection of appropriate distribution for outcome variables (Generalized mixed-effects modelling)
Week 3: Multilevel data structure
Week 4: Preparing predictor variables (Contrast coding, Standardization)
Week 5: How to interpret the results and how to build models
Week 6: Reporting practice
Extra topic: Power analysis: Kumle et al. (2021)
Line.icon
Week 0: How to use R project and how to input the dataset
Free online resources
Douglas et al. (2015). An Introduction to R
Wickham & Grolemund (2017): R for Data Science
R cheatsheets: https://rstudio.com/resources/cheatsheets/
line.icon
Week 1: When to use mixed-effects modelling or multilevel modelling (MLM), vs. traditional multiple regression
Reading
General introduction: Gries (2021)
Counter-argument: McNeish et al. (2017)
Counter-counter argument: Multilevel Regression as Default
Notes
Repeated measurements violates the assumption of traditional linear regression—"independence of observations", meaning that there is some additional, systematic variation of the effects of predictor variable(s) by the repeating/grouping factors.
Simpson's paradox
line.icon
Week 2: Selection of appropriate distribution for outcome variables (Generalized mixed-effects modelling)
https://gyazo.com/5585601abd3bd5a6b87ac6d159250fda
From McElearth (2020)
line.icon
Week 3: Multilevel data structure
Reading
See visualized concept of "nested" or hierarchihcal: An Introduction to Hierarchical Modeling
Blogpost by Dr. Zablotski Mixed Effects Models 2: Crossed vs. Nested Random Effects
Notes
Nested or Crossed, or Partially crossed
Concept of "Level": Lowest = Level 1, Second lowest = Level 2 ...
e.g., Level 1 = Individuals, Level 2 = Department, Level 3 = University
Fully nested model: "Individuals are nested within a particular department"
https://gyazo.com/0604f799f68b421f01fb96e0eab3b8b8
code:Fully nested mixed effects
lmer(response ~ predictor + (1|School/Class)
Longitudinal data usually takes this data structure—Multiple measurements at different time points are nested within the individuals
Crossed random effects: Figure from Dr. Zablotski's post
https://gyazo.com/c7784a80c261204ac4a2225d082af1e4
code:Crossed random effects
lmer ~ predictor + (1|school) + (1|class)
Note: dependency across levels in fully nested models
Tips: if not nested = crossed
https://gyazo.com/58e113a77f02b6ea6486ab312e9ff591
Figure from Dr. Zablotski's post
line.icon
Week 4: Preparing predictor variables (Contrast coding, Standardization)
line.icon
Week 5: How to interpret the results and how to build models
Random-effects structure
Barr et al. (2013)
Random-effects structure = "which treatment effects are assumed to vary across which sampled units, and how they are assumed to vary."
Nonconverging LMEMs were dealt with by progressively simplifying the random effects structure until convergence was reached.
https://gyazo.com/ff1faac43f1da222c47a0a501cfc0aff
Barr (2013): Mixed factorial design
Models testing interactions in designs with replications should include random slopes for the highest-order combination of within-unit factors subsumed by each interaction.
shungosuzuki.icon Here, replication = "multiple observations per sampling unit per cell"
Non-replicated = "If observations are not replicated (i.e., there is only a single observation per unit per cell), random slope variance cannot be distinguished from random error variance and thus random slopes need not be included."
Zhang & Graham (2020)
In cases where a full random effects structure model did not converge, we first took out the interactions between random slopes, and then gradually removed random slopes that accounted for the least variance until a converged model was obtained.
line.icon
Week 6: Reporting practice