SPSS command: SPSS MIXED

Linear mixed models in your browser

Linear mixed models analyse clustered and longitudinal data — respondents within regions, repeated waves within people — by combining fixed effects with random effects and a residual covariance structure.

Free · No account · Files stay on your device · Updated 18 October 2026

What it tells you

Crosstabs runs SPSS MIXED on your device with up to three random-effects blocks, a repeated-measures block with five covariance types, REML or ML estimation and Type III tests with Satterthwaite degrees of freedom.

  • Fixed-effect estimates and Type III F tests that account for the correlation of observations within the same subject or cluster.
  • How much subjects or clusters vary in their baseline (random intercept) and in their response to a covariate (random slope).
  • How repeated measurements correlate over time — AR1 decay, compound symmetry or a fully unstructured matrix.
  • Which covariance structure fits better, by comparing −2 log likelihood, AIC, AICC, CAIC and BIC.

When to use it

Use it when

  • Long-format longitudinal data where people have different numbers of waves — mixed models use every observed row.
  • Respondents nested in interviewers, stores, schools or regions, where ignoring the clustering would overstate significance.
  • Growth-curve questions: does the slope over time differ between people, and does a fixed factor change the average slope?

Use something else when

  • No clustering or repeated measurements: GLM Univariate or linear regression gives the same fixed effects more simply.
  • A binary or count outcome: this panel fits linear models with a normal residual only.
  • Survey data with sampling weights: the panel does not run likelihood tests under a sampling weight; use Complex Samples GLM.
  • Very few clusters (say under five): random-effect variances are poorly estimated; treat the cluster as a fixed factor.

How to run it in Crosstabs

  1. 01

    Open long-format data

    Open a file with one row per observation (for example one row per person per wave) and switch to Statistics mode.

  2. 02

    Choose Linear mixed models

    In the General linear model group, pick Linear mixed models (MIXED).

  3. 03

    Set the fixed part

    Under Variables choose the Dependent variable, Factors and Covariates; under Fixed effects keep Include intercept and optionally tick Include all interactions among factors.

  4. 04

    Add random effects

    In Random effects block 1 tick Random intercept, pick any Random slopes (from the covariates), choose the Subjects variable and a Covariance type (Variance components, Identity, Diagonal, Unstructured or Compound symmetry). Use Add random effects block for nested or crossed effects (up to three).

  5. 05

    Model the repeated measures (optional)

    Tick Model repeated measures (residual covariance), choose the Repeated variable and Subjects, and a Covariance type: Scaled identity, Diagonal, Compound symmetry, First-order autoregressive (AR1) or Unstructured.

  6. 06

    Estimate

    Under Estimation choose Restricted maximum likelihood (REML) or Maximum likelihood (ML), then click Run. Use ML when comparing models with different fixed effects by likelihood.

Worked example

Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.

Data

84 synthetic reaction-time measurements (ms): 14 drivers (id) each tested on days 0–5 of sleep restriction. Every driver gets their own baseline and their own slope over days, drawn from normal distributions with a fixed seed, plus measurement noise.

Type III Tests of Fixed Effects
SourceNumerator dfDenominator dfFSig.
Intercept113.000797.159<.001
days113.00027.904<.001

Denominator degrees of freedom use the Satterthwaite approximation.

Estimates of Fixed Effects
ParameterEstimateStd. ErrordftSig.95% CI
Intercept246.328.7213.0028.234<.001227.47 to 265.17
days10.491.9913.005.282<.0016.20 to 14.78
Estimates of Covariance Parameters
ParameterEstimateStd. ErrorWald ZSig.
Intercept + days [subject = id]: UN (1,1)901.91419.092.152.031
Intercept + days [subject = id]: UN (2,1)−27.3870.66−0.387.698
Intercept + days [subject = id]: UN (2,2)37.3221.901.704.088
Residual312.4459.045.292<.001

Estimation method: restricted maximum likelihood (REML); unstructured (UN) covariance for the random intercept and slope.

How to read it

On average reaction time rises by 10.49 ms per day of sleep restriction (95% CI 6.20 to 14.78). The Type III test gives F(1, 13.00) = 27.90, p < .001; because the slope varies from driver to driver, the Satterthwaite denominator df (13.00) reflects the 14 drivers, not the 84 measurements. −2 restricted log likelihood is 766.39 (AIC 774.39).

Output tables explained

Model Dimension
Every fixed, random and repeated effect with its number of levels, covariance structure, number of parameters, subject variables and number of subjects — a check that the model is what you intended.
Information Criteria
−2 (restricted) log likelihood, AIC, AICC, CAIC and BIC in smaller-is-better form, for comparing covariance structures fitted to the same data.
Type III Tests of Fixed Effects
Numerator df, Satterthwaite denominator df, F and significance for the intercept and each fixed effect.
Estimates of Fixed Effects
Each parameter's estimate, standard error, Satterthwaite df, t, significance and 95% confidence interval; the last level of a factor is the redundant reference.
Estimates of Covariance Parameters
Random-effect variances and covariances, repeated-measures parameters such as AR1 rho, and the residual, each with a Wald Z test and confidence interval. A variance on the boundary has no standard error.

Assumptions and notes

  • Random effects and residuals are normally distributed with mean zero and independent of each other.
  • Subjects (clusters) are independent; correlation is allowed only within a subject, as specified by the covariance structures.
  • Missing outcomes are assumed missing at random; rows with a missing model variable are excluded listwise, but the rest of that subject's rows are kept.
  • Frequency weights are allowed only with a scaled-identity repeated covariance, as in SPSS MIXED; sampling weights are not used for tests.

How the results are validated

Thirteen models — random intercepts and slopes, nested, crossed, factorial, and AR1, CS, UN and diagonal repeated structures — are checked against R 4.6 lme4 2.0.6 with lmerTest 3.2.1 (−2LL to a relative 1e-8, fixed effects 1e-6, standard errors 1e-5, Satterthwaite df and Type III F 1e-4) and nlme 3.1.170 for the repeated structures, and against an independent dense SciPy implementation with numerical derivatives (information criteria 1e-8, covariance parameters 2e-4). A statsmodels MixedLM fit cross-checks the random-slope model. Validation evidence

Questions

REML or ML?

REML gives less biased variance estimates and is the default. Use ML only when you compare two models that differ in their fixed effects with a likelihood-ratio test or information criteria.

Random intercept, random slope or repeated covariance?

A random intercept lets each subject have its own level; a random slope lets each have its own trend over a covariate such as time. A repeated covariance (for example AR1) models how residuals of nearby waves correlate. Compare fits with AIC or BIC.

Why are the denominator df not whole numbers?

They use the Satterthwaite approximation, which estimates the effective df from the variance components. For a slope that varies by subject, the df are close to the number of subjects, not the number of rows.

What does a Hessian warning mean?

Some covariance parameter is at the boundary — usually a variance estimated at zero — so its standard error is not reported. Simplify the random part, for example drop the random slope or use a diagonal instead of unstructured matrix.

Does the panel give estimated marginal means?

No. It reports the fixed-effect estimates and Type III tests; for marginal means of a balanced, complete design, GLM Univariate or Repeated Measures provide them.

Is my data uploaded?

No. The model is fitted by a Web Worker in your browser; very large clusters may exceed what the browser engine handles, and the panel says so.

Run Linear Mixed Models on your own data

Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.

Open the workspace

SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.