Statistics & Analysis
Mixed Model
Definition
A mixed model, also called a mixed effects model, is a statistical framework that contains both fixed effects (population level parameters that apply to the entire sample or population) and random effects (parameters that vary across groups, individuals, or clusters). It is designed for analyzing data that have a hierarchical, clustered, or repeated measures structure where observations within a group are correlated.
Why it matters
Mixed models are among the most versatile and widely used statistical tools in modern research. They handle the complexity of real world data structures that simpler methods cannot accommodate: patients nested within hospitals, students within classrooms, repeated measurements within individuals, or items within participants in psychological experiments. By explicitly modeling the correlation among observations within the same group, mixed models produce more accurate standard errors and p values than analyses that treat the observations as independent. They are standard in clinical trials (analyzing repeated measures), education research (modeling multilevel data), linguistics (analyzing nested experimental designs), and ecology (accounting for spatial or temporal correlation).
How it works
In a mixed model, fixed effects represent the average relationships of interest across the entire population or sample. For example, in a clinical trial with repeated measures, the fixed effects might include the treatment group (drug versus placebo) and time (baseline, 3 months, 6 months). These effects describe the average treatment difference and the average change over time.
Random effects capture variability among groups or individuals. A random intercept allows each participant to have their own baseline level (some patients start with higher blood pressure than others), while a random slope allows the relationship between time and the outcome to differ across participants (some patients improve faster than others). The combination of fixed and random effects produces both population level inferences (what is the average treatment effect?) and group or individual level predictions (what is the expected trajectory for a specific patient?). In a linear mixed model the fixed effects can also be read as population averaged effects, but in a generalized linear mixed model (for example, a mixed logistic model) they are subject specific, conditional on the random effects, and generally differ from the population averaged estimates that generalized estimating equations (GEE) produce.
Estimation typically uses restricted maximum likelihood (REML), which provides less biased estimates of variance components than ML, or full maximum likelihood (ML), which is used when comparing models with different fixed effect structures. Common covariance structures for the repeated measurements within a participant (modeled through the random effects, the residuals, or both) include unstructured (which estimates all variances and covariances freely), compound symmetry (which assumes equal correlations between all time points), and autoregressive (which assumes correlations decrease with increasing time lag).
Mixed models handle missing data more gracefully than traditional repeated measures ANOVA because they do not require complete data for every participant. Under the assumption that data are missing at random (MAR), and provided the model is correctly specified, the mixed model uses all available observations to estimate the parameters, producing valid inference without requiring imputation. This is why mixed models for repeated measures (MMRM) are a common primary analysis for longitudinal clinical trials that include all randomized participants, although MAR cannot be verified from the data, so sensitivity analyses under other missing data assumptions are advisable.
When to use it
Use a mixed model when your data have a grouped, nested, or repeated measures structure and you want to account for the correlation among observations within groups. Common applications include longitudinal studies (repeated measurements within participants), multicenter trials (patients within sites), cluster randomized trials (individuals within clusters), cross over designs (treatments within participants), and psycholinguistic experiments (items within participants). Mixed models are preferred over repeated measures ANOVA when data are unbalanced (different numbers of observations per participant), when missing data are present, or when the covariance structure needs to be modeled flexibly.
Key takeaways
- Mixed models are among the most versatile and widely used statistical tools in modern research.
- For example, in a clinical trial with repeated measures, the fixed effects might include the treatment group (drug versus placebo) and time (baseline, 3 months, 6 months).
- Use a mixed model when your data have a grouped, nested, or repeated measures structure and you want to account for the correlation among observations within groups.
- A common error is failing to specify a random effect structure that matches the study design, either by omitting random effects that are needed (leading to pseudoreplication and inflated Type I error) or by specifying overly complex random effects that the data cannot support (leading to convergence failures).
Common mistakes
A common error is failing to specify a random effect structure that matches the study design, either by omitting random effects that are needed (leading to pseudoreplication and inflated Type I error) or by specifying overly complex random effects that the data cannot support (leading to convergence failures). Another mistake is comparing models with different fixed effects using REML (which produces valid variance component estimates but not valid likelihood ratios for fixed effects comparisons); ML should be used for fixed effects comparisons. Some researchers default to compound symmetry for the covariance structure without testing whether it fits the data, when a more flexible structure (such as unstructured or autoregressive) may be more appropriate. Finally, interpreting the results of a mixed model without checking model diagnostics (residual plots, assessment of random effects distributions) can lead to incorrect conclusions.
Example
A multicenter clinical trial compares a new antidepressant to placebo in 400 patients across 20 sites, with depression severity measured by the Hamilton Depression Rating Scale (HDRS) at baseline, 4 weeks, 8 weeks, and 12 weeks. A mixed model is specified with fixed effects for treatment group, time, and the treatment by time interaction, and random effects for participant (random intercept) and site (random intercept). The treatment by time interaction is significant (p = 0.003), with the treatment group showing a 4.2 point greater reduction in HDRS at 12 weeks compared to placebo. The random intercept for site accounts for 8% of the total variance, indicating that between site differences exist but are modest.
Sources
- [1]Field A. Discovering Statistics Using IBM SPSS Statistics. 6th ed. SAGE Publications, 2024.
- [2]Laird NM, Ware JH. Random-effects models for longitudinal data. Biometrics. 1982;38(4):963-974.
- [3]Bates D, Mächler M, Bolker B, Walker S. Fitting linear mixed-effects models using lme4. Journal of Statistical Software. 2015;67(1):1-48.
- [4]Fitzmaurice GM, Laird NM, Ware JH. Applied Longitudinal Analysis. 2nd ed. Wiley, 2011.
Cite this term
Mixed Model. Paperguide Research Glossary. Paperguide, 2026. Available at: https://paperguide.ai/research-glossary/mixed-model/(Paperguide, 2026)