What do I learn here?
When data have a
group structure (persons, schools, clinics),
simple regressions are problematic β observations within a group
are not independent. Mixed Models solve this through
Random Effects:
each group gets its own intercept uββ±Ό, drawn from a common
distribution N(0, Οβ).
Recommended exploration
- Start with Partial Pooling β this is the LMM/GLMM
- Compare No Pooling vs. Complete Pooling β where do the lines diverge?
- Vary Οβ (random effect SD) β when does shrinkage become visible?
- Toggle β‘ Outlier Group β how does each pooling strategy react?
- Vary number of groups J and group sizes n_j β how does shrinkage change?
- Compare AIC/BIC in the model results β when does Partial Pooling outperform No/Complete Pooling?
- Load the β Simpson preset and observe Complete Pooling β why is Partial Pooling indispensable here?
The most important panels
Group lines: Fixed Effect (Ξ³ββ + Ξ³ββΒ·x) + group-specific
deviation uββ±Ό β Partial Pooling shrinks all lines toward the grand mean
Shrinkage diagram: No-pooling estimate β Partial-pooling estimate;
arrows show the pull. Groups with small n are pulled more strongly.
ICC bar: ΟβΒ²/(ΟβΒ²+ΟΒ²) β proportion of variance between groups.
ICC > 0.05 indicates that a mixed model is needed.
Simpson warning: appears when Complete Pooling reverses the direction
of the slope β the classic Simpson's Paradox.
GLM families
Gaussian: continuous data β classic LMM
Poisson: count data (0,1,2,β¦) β log link
Gamma: positive continuous data β log link
Logistic: 0/1 data β logit link