Model an outcome when observations are nested in people, classes or sites.
A linear mixed model (also called a multilevel or hierarchical linear model) is a regression for data with a nested structure: repeated measurements within the same participants, pupils within classes, patients within hospitals. Ordinary regression treats every row as independent; when rows come in clusters, that assumption fails and standard errors are too small.
The model splits the effects into fixed effects — the predictors you want to estimate, such as time or treatment — and random effects, which let each cluster have its own baseline (random intercept) and, optionally, its own slope for one predictor (random slope). It handles unbalanced data and missing time points without dropping whole participants, which is a major advantage over repeated-measures ANOVA.
StatRyx fits the model by restricted maximum likelihood (REML) with statsmodels MixedLM. It reports each fixed effect with B, SE, z, p and a 95% confidence interval; the random-effect variances; the intraclass correlation (ICC), which says how much of the variance lies between clusters; and marginal and conditional R² (Nakagawa & Schielzeth, 2013) — the variance explained by the fixed effects alone and by fixed plus random effects.
The data must be in long format: one row per observation, with a column identifying the cluster (for example participant ID). The outcome should be continuous, and the residuals roughly normal.
| Effect | B | SE | z | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 50.46 | 1.17 | 43.01 | < .001 | [48.16, 52.76] |
| Wave | 2.38 | 0.27 | 8.70 | < .001 | [1.84, 2.91] |
| Random intercept SD (pupil) | 5.79 | ||||
| Residual SD | 3.34 |
A linear mixed model with random intercepts for pupils (120 observations from 30 pupils) showed that reading scores increased by 2.38 points per wave, B = 2.38, SE = 0.27, 95% CI [1.84, 2.91], z = 8.70, p < .001. The intraclass correlation was .60; marginal R² = .14 and conditional R² = .78.
Yes. You can run it without an account (3 free analyses), and a free account adds 10 more — a one-time allowance, no payment needed. Every result includes the APA 7 write-up. Paid plans (Student from $9/month) add more analyses and Word, PDF and Excel export.
Describe the random-effects structure and estimation method, then give each fixed effect with B, SE, the test statistic, p and a 95% CI. Add the ICC and R²: "B = 2.38, SE = 0.27, 95% CI [1.84, 2.91], z = 8.70, p < .001; ICC = .60."
A mixed model keeps participants with missing time points, allows unequal spacing between measurements and can include continuous predictors. Repeated-measures ANOVA needs complete, balanced data. For anything beyond a small complete design, the mixed model is usually the better choice.
The intraclass correlation is the share of the total variance that lies between clusters. An ICC of .60 means 60% of the variation in scores is due to stable differences between participants.
Yes. Name one predictor as a random slope in your request, for example 'random slope for wave', and each cluster gets its own slope for that predictor.
Run a Linear Mixed Model on your data →