Analyses

Linear mixed model

Predict a numeric outcome when people are nested in groups.

Edit on GitHub

When to use it

Use a linear mixed model when the outcome is a score and the rows are clustered, such as patients in clinics or pupils in schools. A random intercept lets each clinic have its own baseline. The hours slope is still one number for the whole sample.

Mixed Model is the menu item that posts random slopes and the REML switch, and it prints a confidence interval. Multilevel modelling fits this same model and adds an ICC.

Assumptions

The outcome and the fixed effects are numeric. The grouping column has at least two clusters. Rows in the same cluster are not independent. This fit uses REML. It does not test normality of the residuals.

Running it in Tensr

Multivariate → Mixed Models → Linear Mixed Model (LMM). In chat: “Linear mixed model of score on hours, grouped by clinic.”
Dependent is the numeric outcome. Fixed effects need at least one predictor. Grouping variable is the cluster, such as clinic.

The dialog also shows random slopes and a REML switch. Mixed Model is the procedure that posts those fields. This request sends the dependent, the fixed effects, and the group column. The fit uses REML and a random intercept for the group. An API call can also send random_effects. Each of those columns must already be a fixed effect, and each one is added as a random slope.

Options

Prop

Type

Reading the output

The same clinics and the same hours slope, fit as a linear mixed model with REML and a random intercept.

TermEstimateStd. Errp-value
const45.77422.35335p < .001
hours0.9739090.393446p = .013
ComponentVarianceStd. Dev
Random intercept (clinic)18.68574.3227
Residual21.01284.58397

Linear mixed model for score with random intercept by clinic. Linear mixed model for score with random intercept by clinic. Metrics: AIC = 735.109; Observations = 120; Groups = 12.

Reporting (APA 7)

Linear mixed model for score with random intercept by clinic. Report the estimate in the table. This procedure is not summarised by one p-value.

Coming from SPSS

The product menu is Multivariate → Mixed Models → Linear Mixed Model (LMM). SPSS fits the same idea with MIXED, using a RANDOM intercept and METHOD=REML.

The same engine with an ICC is multilevel modelling. Random slopes, a confidence interval, and a null-model ICC are on Mixed Model. A binary clustered outcome is GEE or a GLMM.