Analyses

Mixed model

Random-intercept model with a null-model ICC, z, and a confidence interval.

Edit on GitHub

When to use it

Use Mixed Model when people are nested in groups and you want the slope, its confidence interval, and how much of the outcome the groups account for before any predictor is added. The ICC on this page comes from that empty model. The coefficient table comes from the model that includes your fixed effects.

The agent sends “mixed model” and “LMM” here. The linear mixed model menu item is a separate request.

Assumptions

The outcome is numeric. The grouping column needs about 10 or more groups. With fewer than 10, the report warns that a mixed model is poorly identified and points at cluster-robust ordinary least squares. An unconverged fit is not a finished result. A random slope that does not vary inside groups is not identified.

Fixed effects may be empty. That run is an intercept-only model. This example includes one predictor.

Running it in Tensr

Multivariate → Mixed Models → Mixed Model. In chat: “Mixed model of score on hours, grouped by clinic.”
Dependent is the numeric outcome. Grouping variable is the cluster. Fixed effects can be empty.
Random slopes start empty, which is a random intercept only. Estimation starts at REML. ML is the other choice.

Options

Prop

Type

Reading the output

Twelve clinics, ten students each. Clinic shifts the intercept. Hours has a moderate slope. The model reports a null-model ICC, z, and a confidence interval.

TermCoefficientSEzp95% CI low95% CI high
Intercept45.7742.35319.45< .00141.16250.387
hours0.9740.3932.475.0130.2031.745
ComponentVarianceStd. Dev
Random intercept (clinic)18.6944.324
Residual21.0124.584

Mixed model for score nested in clinic. Mixed model for score nested in clinic. Metrics: ICC (null model) = 0.483; Groups = 12; Observations = 120; Singletons = 0; Log-likelihood = -364.554; AIC = 735.109.

Reporting (APA 7)

Mixed model for score nested in clinic. Report the estimate in the table. This procedure is not summarised by one p-value.

Notes

This fit still prints a singular-covariance warning. A singular fit means the random-effects covariance is on the edge of the parameter space, usually because a variance is estimated at zero or two random terms are perfectly correlated. With a random intercept only, that often means the clinic variance is hard to separate from the residual. The hours slope here is identified (0.974, p = .013) and matches the linear mixed model, so the warning is worth printing and the slope is still usable. Ignore the warning only when the fixed-effect you care about is identified and the variance components still make sense. If a random slope is in the model and the warning appears, drop that slope.

Coming from SPSS

The product menu is Multivariate → Mixed Models → Mixed Model. SPSS fits this with MIXED. The path string stored for this item says Analyze → Mixed Models → Mixed Model. The item itself is on the Multivariate menu.

A shorter coefficient table from the same engine is the linear mixed model. The ICC after the predictor is in the model is multilevel modelling. Fewer than 10 groups: linear regression can take a cluster column.