Topics Covered
Nested Data Structures
Understand why trials within subjects violate independence and how ignoring this hierarchy inflates Type I errors.
Fixed vs. Random Effects
Fixed effects estimate population-level averages, while random effects model the variation between individuals or groups.
Partial Pooling & Shrinkage
How mixed models find the "middle ground" between treating everyone the same and treating everyone as totally unique.
Visual Insights: The Dragon Dataset
Mixed models help us see through "clutter" caused by grouping factors. If we ignore mountain ranges, we might miss the real effect (or lack thereof) of body length.
The Independence Fallacy
[A boxplot showing test scores varying wildly across differrent mountain ranges, proving that data points are clustered.]
Random Intercepts
[A plot with 8 different lines, each starting at a different baseline, representing the unique intercept for each mountain.]
Key Concepts
- Pseudo-replication: Treating correlated data points as independent observations.
- Random Intercepts: Allowing each group (e.g., subject) to have its own baseline.
- Random Slopes: Allowing the relationship between X and Y to vary per group.
- ICC (Intraclass Correlation): Quantifying how much variance is explained by the grouping factor.
Homework
- Run
intro_mixedmodels.Rand compare thebasic.lmwithmixed.lmer. - Identify which mountain range has the highest baseline intelligence using the caterpillar plot.
- Explain why standardizing (scaling) predictors is crucial for complex mixed models.