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