Mixed Effects Model
Linear mixed effects models online with random intercepts and slopes, REML and ML, ICC and AIC.
When to use it
Use when observations are clustered (multiple measurements per subject, students nested within schools, plots within fields, repeat visits per patient). The model partitions variance into between-cluster and within-cluster components and gives correct standard errors that account for non-independence.
When NOT to use it
Do not use when there is no real clustering structure; ordinary regression suffices. Do not use a random intercept when slopes also vary across clusters; specify the random slope explicitly. For binary or count outcomes use the GLMM tool instead.
What you get
REML estimation by default (ML available for nested model comparison via likelihood ratio). Variance components for the random intercept and the residual; intra-class correlation (ICC); fixed-effect coefficients with SEs and t-tests using between-within or Satterthwaite degrees of freedom; AIC and BIC for model selection.
How to interpret the output
ICC equals random-intercept variance divided by total variance; values above 0.05 indicate non-trivial clustering and justify the mixed model. The fixed-effect t-tests have approximate df because the small-sample distribution under REML is not exactly t. Use likelihood-ratio tests on ML (not REML) fits when comparing nested fixed-effect structures.
Common pitfalls
- Comparing REML fits with different fixed effects (use ML for those LR tests).
- Forgetting that random-intercept-only models assume slopes are equal across clusters.
- Reporting Wald p-values when LR or Satterthwaite is more accurate.
- Confusing ICC with R-squared.
Try it in StatVeda
The Linear Mixed-Effects (random intercept) engine runs entirely in the browser. No signup, no install, no data sent to a server. Paste your data, hit Run, copy the output.
Open Linear Mixed-Effects (random intercept)References
- Pinheiro, J. C. and Bates, D. M. (2000). Mixed-Effects Models in S and S-PLUS. Springer, New York.
- Snijders, T. A. B. and Bosker, R. J. (2011). Multilevel Analysis, 2nd edition. SAGE, London.
- Bates, D., Maechler, M., Bolker, B. and Walker, S. (2015). Fitting linear mixed-effects models using lme4. Journal of Statistical Software, 67(1), 1 to 48.