Linear Mixed Effects (LMM) — clustered / repeated data (ICC, BLUPs)

Verified

Advanced & specialized

Independently verified. Every statistic this test reports has been re-derived against an independent reference — never the library the pipeline itself calls — the rendered output was read back in a browser, and the result is locked with a committed regression suite.

Run this test straight away on a free built-in teaching dataset — no data of your own needed — or bring your own. Either opens the guided workspace: variable setup, assumption diagnostics, results with effect sizes and confidence intervals, figures, and APA-ready reporting.

Loading teaching datasets…

Or use your own dataset

Loading your datasets…

Fits y = Xβ + Zu + ε with FIXED effects β (population-level) and RANDOM effects u (group-level deviations) — handles clustered, nested, and longitudinal data with proper accounting for the multi-level

dependence structure. Reports fixed-effect coefficients with SE + 95% CI + p, variance components per random effect, intraclass correlation (ICC), marginal and conditional R² (Nakagawa-Schielzeth), model fit (log-likelihood, AIC, BIC), group-level BLUPs, and an OLS comparison documenting the clustering motivation. Handles missing-at-random (MAR) data without listwise deletion.

Worked example

Does a therapy reduce symptoms over time, allowing for repeated visits per patient?

Symptom scores across multiple visits per patient were modelled with a linear mixed-effects model (random intercept per patient) — the right tool for clustered / repeated data.

Result

Symptoms fell about 1.2 points per visit (fixed effect b = −1.23, p < .001); between-patient variation was substantial (ICC = .76).

How you'd report it (APA)

A linear mixed-effects model showed symptoms decreased significantly over visits, b = −1.23, p < .001 (random intercept per patient, ICC = .76).

Try it yourself: Load this ready-made sample and follow the run above.

When to use it

  • Nested / cross-sectional clustering (random intercept)
    Test score ~ ses + gender + (1 | school) (n = 5000 students × 100 schools).
  • Longitudinal / repeated measures (random intercept per subject)
    Depression score ~ time + treatment + (1 | subject) (n = 100 patients × 5 visits).
  • Random intercept + random slope (subject-specific trajectories)
    Depression ~ time + treatment + (time | subject) — each patient has own baseline AND own recovery rate.

When NOT to — use instead

Hypotheses

H₀: β_j = 0 for each fixed-effect coefficient (and H₀_random: σ²_u = 0 for the random intercept variance).
Hₐ: at least one β_j ≠ 0; σ²_u > 0 signals meaningful clustering.

Parameter tested: fixed-effect coefficients β + variance components (σ²_u, σ²_e)

Assumptions (and what to do if they fail)

ICC (intraclass correlation) — σ²_u / (σ²_u + σ²_e). ICC ≥ 0.05 justifies the mixed-effects model; ICC < 0.05 means OLS would give almost identical inference with one fewer parameter.medium

Check: ICC value.

If violated: ICC ≈ 0 → no meaningful between-cluster variance → LMM and OLS give the same answer.

Level-1 residuals (ε_ij = y − x'β − u_j) are approximately normal.medium

Check: Shapiro-Wilk p-value.

If violated: Non-normal residuals affect small-sample CIs.

Group-level random intercepts (u_j) are approximately normally distributed.medium

Check: Shapiro-Wilk on BLUPs.

If violated: Non-normal BLUPs can indicate an unmodelled predictor driving between-cluster differences.

Level-1 residual variance is approximately constant across groups and across fitted values.medium

Check: Levene's test p.

If violated: Heteroscedasticity can be addressed via heteroscedastic LMMs (weights parameter).

Ready to run a Linear Mixed Effects (LMM) — clustered / repeated data (ICC, BLUPs) on your own data?

Guided setup, automatic assumption checks, effect sizes, figures and an APA write-up.

Run this test →