Regression · Mixed Models

Linear Mixed-Effects Model

Fit a linear mixed-effects model with a random intercept for grouped (nested / clustered / repeated-measures) data.

In the menus Regression › Mixed Models › Linear Mixed-Effects Model

Also searched as mixed model mixed effects lmm lme multilevel model hierarchical linear model hlm random effects

When to use it

Predict a continuous outcome when observations are grouped (students within schools, measurements within subjects, samples within sites) and you must account for the within-group correlation a plain regression ignores.

When not to: You need random SLOPES (a predictor's effect varying by group), two or more CROSSED random-effect factors, or a non-normal (generalized) response, none of which this random-intercept-only function supports; or when the grouping factor has fewer than 2 groups, which the model refuses outright.

Step by step

  1. Open it from the menu

    Click Regression in the menu bar; under Mixed Models choose Linear Mixed-Effects Model.

  2. Fill in the form

    Choose the columns: What you want to predict or explain, Columns that may explain it, Clusters (random intercept). The form lists only columns whose type fits each field.

  3. Check the options

    The options start at their defaults: Alpha, Confidence level. Change one only when your question needs it.

  4. Run the analysis

    Press Run analysis. The Result Card opens on its Results tab.

What to choose in the form

Fields of the Linear Mixed-Effects Model form
What you want to predict or explain Response requiredOne numeric column. Continuous outcome variable (Y / dependent)
Columns that may explain it Predictors requiredOne numeric or categorical or ordered categorical column. One or more fixed-effect predictors. Categorical predictors are auto-encoded.
Clusters (random intercept) Group requiredOne categorical or ordered categorical column. Categorical grouping column for the random intercept (1 | group).
AlphaSignificance threshold for the per-predictor z-tests Default: 0.05.
Confidence levelConfidence level for coefficient intervals (e.g. 0.95) Default: 0.95.

How to read the card

The Results tab starts with what to know first (rows left out, checks that did not pass), then the interpretation in words and the Key Results; charts and assumption checks follow further down. Learn More explains the method in plain words. Read a Result Card covers all four tabs.

What it assumes

Normality (of residuals, not of the raw data)

If it does not hold: Non-normal residuals make the model's standard errors and any inference on the fixed-effect coefficients approximate rather than exact.

How to check: Shapiro-Wilk on the model residuals (for 3 to 5000 residuals), reported directly on the card.

Independence of observations

If it does not hold: The whole point of a mixed model is to account for non-independence WITHIN a group (e.g. repeated measures on the same subject); the model still assumes independence BETWEEN groups, and any additional dependency not represented by the grouping structure (e.g. subjects nested in clinics that are themselves related) biases the standard errors.

How to check: Not checked by KernelStats; only the single specified grouping variable's structure is modeled; a more complex (e.g. crossed or nested multi-level) dependency structure needs a more general model this function does not fit.

A worked example

Predicting penguin body mass from flipper length, with island as the random-intercept grouping factor (three islands, unequal penguin counts per island).

Result: Flipper length: beta = 45.0 g per mm (95% CI [41.3, 48.7]), z = 23.8, p < .001; random-intercept variance sigma_u^2 = 16,818, residual variance sigma_eps^2 = 146,471, ICC = 0.10 (REML).

About a tenth of the leftover variance in body mass (after flipper length) sits between islands. That is modest but not zero, so rows from the same island are somewhat alike and the random intercept is a reasonable safeguard. With only three islands, though, the between-island variance is estimated from three group effects and is very uncertain; a grouping factor with so few levels is often better entered as a fixed effect.

From the Statistics Library.

The code tabs

Code gives this analysis as Python, R and MATLAB code (and SAS where the tab offers it), reading the data the way KernelStats did. Export sends the card to a report or to slides. See The Code tab.

Understand the statistics

Ask Oobi

Type one of these into Ask Oobi beside your data:

  • Does flipper length predict body mass once we allow each island its own baseline?
  • Explain the linear mixed-effects model (random intercept) in plain words.
  • What does independence of observations mean?

Last reviewed November 16, 2026.

Report an unclear step