Mixed Effects Model
Linear Mixed Effects Model · Also known as: LME, LMM, mixed model, random effects model
A mixed effects model (or linear mixed model) extends ordinary regression by including both fixed effects — population-level parameters shared by all observations — and random effects that capture subject-, group-, or cluster-level variability. It is the standard tool for repeated-measures, longitudinal, and multilevel data where observations within the same unit are correlated.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
+5 more
When to use it
Use a mixed effects model whenever your outcome is continuous and observations are clustered or repeated: longitudinal studies with multiple measurements per subject, educational data with students nested in classrooms or schools, clinical trials with patients nested in sites, or any design with a natural grouping variable. The key signal is non-independence — if ignoring the clustering would lead to artificially small standard errors and inflated Type I error, a mixed model is warranted. Do not use it when observations are truly independent (standard OLS is simpler and equally valid), when group sizes are very small (fewer than five groups with one observation each make variance component estimation unreliable), or when the outcome is not continuous (use a generalized linear mixed model instead).
Strengths & limitations
- Properly accounts for non-independence from repeated measures, longitudinal, or nested data, giving valid standard errors and p-values.
- Handles unbalanced designs and missing observations at a given time point gracefully — subjects with incomplete data contribute whatever measurements they have.
- Simultaneously models population-level fixed effects and unit-level random effects, providing both group-average and subject-specific predictions.
- Generalises naturally to generalized linear mixed models (GLMMs) for binary, count, or other non-normal outcomes.
- Partial pooling of group estimates shrinks noisy group-level estimates toward the grand mean, reducing overfitting compared to separate regressions per group.
- Requires decisions about random-effect structure (random intercepts only vs. random slopes) that can substantially affect conclusions; over-specified random structures may fail to converge.
- Inference on fixed effects depends on approximations to denominator degrees of freedom (Kenward-Roger, Satterthwaite) that are imperfect, especially with small samples.
- Assumes normally distributed random effects and residuals; pronounced departures (e.g., heavily skewed outcomes) can distort variance component estimates.
- Computationally more demanding than OLS; complex random-effect structures with many predictors and groups may require long fitting times or fail to converge.
- Interpretation of random-effect variance components requires understanding of variance partitioning (ICC), which is less intuitive than plain OLS slopes.
Frequently asked
What is the difference between a fixed effect and a random effect?
Fixed effects are population-level parameters whose levels are of direct interest and are fully estimated (e.g., treatment vs. control). Random effects represent a sample of levels drawn from a larger population (e.g., participating schools), and their variability is summarised by a variance component rather than individual coefficients.
Should I use ML or REML for estimation?
Use REML when comparing models that differ only in their random-effect structure — REML gives unbiased variance component estimates. Use ML when comparing models that differ in their fixed effects via likelihood-ratio tests, because REML likelihoods are not comparable across different fixed-effect structures.
How do I know if I need a mixed model or just OLS with clustered standard errors?
A mixed model is preferable when you want to model and partition the grouping variance, make predictions for specific groups, or have a small number of groups with many observations each. Clustered standard errors (robust SEs) are a lighter-weight fix when you only care about correct inference on fixed effects and do not need group-level predictions.
What is a singular fit warning and what should I do?
A singular fit means one or more variance components are estimated as exactly zero, indicating the random-effect structure is more complex than the data support. Simplify by removing random slopes or constraining the random-effect correlation structure.
Can mixed models handle missing data?
Yes, under the missing at random (MAR) assumption. Subjects with some missing time points still contribute all their observed measurements to the likelihood, so the model uses all available data without imputation. If data are missing not at random (MNAR), additional sensitivity analyses are needed.
Sources
- Laird, N. M., & Ware, J. H. (1982). Random-effects models for longitudinal data. Biometrics, 38(4), 963–974. DOI: 10.2307/2529876 ↗
- Pinheiro, J. C., & Bates, D. M. (2000). Mixed-Effects Models in S and S-PLUS. Springer. ISBN: 978-0387989570
How to cite this page
ScholarGate. (2026, June 3). Linear Mixed Effects Model. ScholarGate. https://scholargate.app/en/statistics/mixed-effects-model
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Bayesian Mixed Effects ModelStatistics↔ compare
- Generalized Linear ModelStatistics↔ compare
- Hierarchical Linear ModelStatistics↔ compare
- Multilevel ModelingResearch Statistics↔ compare