Tutorials › Biostatistics › Linear Mixed Effects Models for Longitudinal Data

Longitudinal & Mixed Models

Linear Mixed Effects Models for Longitudinal Data

A practical guide to modeling continuous repeated measurements with fixed effects, random effects, within-subject correlation, treatment-by-time interactions, covariance structures, estimation, inference, and clinical trial interpretation.

Advanced 18 min read

What You'll Learn

  • Why mixed models are useful for repeated longitudinal measurements
  • How fixed effects and random effects represent different sources of variation
  • How treatment, time, and treatment-by-time interactions are interpreted
  • How random-intercept and random-slope models account for subject heterogeneity
  • How residual covariance structures affect longitudinal inference
  • How to implement and report a mixed model in R and SAS

Introduction

Longitudinal clinical studies measure the same participant repeatedly over time. A patient may have a baseline measurement followed by assessments at Week 2, Week 4, Week 8, and Week 12. These observations are informative precisely because they come from the same individual—but that also means they are not independent.

A linear mixed effects model (LMM) is one of the standard approaches for analyzing a continuous longitudinal endpoint. It separates the population-average effects of interest from subject-specific sources of variation and explicitly models the dependence among repeated observations.

Key idea: A mixed model combines fixed effects, which describe systematic population-level relationships, with random effects, which describe subject-level departures from those relationships. The model therefore handles both the mean structure and the repeated-measure correlation.

The Longitudinal Data Structure

Suppose participant \(i\) is measured at times \(t=1,\ldots,m_i\). Let \(Y_{it}\) denote the continuous outcome. A typical clinical-trial dataset might look like this:

SubjectTreatmentVisitTimeOutcome
001ActiveBaseline072.4
001ActiveWeek 4468.1
001ActiveWeek 8863.5
002PlaceboBaseline070.2
002PlaceboWeek 4469.8
002PlaceboWeek 8869.1

The repeated outcomes for Subject 001 tend to resemble one another more than an outcome from a randomly selected participant. That dependence is the central statistical feature that a longitudinal mixed model must address.

Why Not Use Ordinary Linear Regression?

Ordinary linear regression assumes that, conditional on the covariates, the observations are independent. If the same patient contributes several observations, this assumption is generally false.

For example, if a study has 100 patients measured at 5 visits, there are 500 rows of data but not 500 independent experimental units. The independent units are the patients.

Consequence of ignoring correlation: Treating repeated observations as independent can lead to standard errors that are too small and therefore confidence intervals and hypothesis tests that are too optimistic. A mixed model avoids this by incorporating subject-level and/or residual covariance.

The Basic Linear Mixed Model

A useful general form is:

\[ Y_i = X_i\beta + Z_i b_i + \varepsilon_i \]

Here:

  • \(Y_i\) is the vector of repeated outcomes for subject \(i\).
  • \(X_i\) is the fixed-effects design matrix.
  • \(\beta\) contains the fixed-effect parameters.
  • \(Z_i\) is the random-effects design matrix.
  • \(b_i\) contains subject-specific random effects.
  • \(\varepsilon_i\) is the within-subject residual vector.

A common assumption is:

\[ b_i \sim N(0,G), \qquad \varepsilon_i \sim N(0,R_i), \qquad b_i \perp \varepsilon_i \]

The marginal covariance of the repeated outcomes is then:

\[ V_i = Z_iGZ_i^\mathsf{T}+R_i \]

This equation is central to understanding mixed models. The covariance among observations can arise from shared random effects, from a specified residual covariance structure, or from both.

Fixed Effects vs. Random Effects

ComponentPurposeTypical examples
Fixed effectPopulation-level systematic effectTreatment, visit, baseline, sex, treatment × visit
Random effectSubject-specific deviation from the population patternRandom intercept, random slope
Residual covarianceRemaining within-subject dependenceCompound symmetry, AR(1), unstructured

The distinction is conceptual rather than simply a question of whether a variable is categorical or continuous. Fixed effects describe parameters of scientific interest; random effects describe a probability distribution for subject-specific deviations.

A Simple Random-Intercept Model

The simplest longitudinal mixed model gives each participant a personal baseline level:

\[ Y_{it}=\beta_0+\beta_1\operatorname{Time}_{it}+\beta_2\operatorname{Treatment}_i+b_{0i}+\varepsilon_{it} \]

where \(b_{0i}\) is the random intercept for subject \(i\).

The interpretation is intuitive: every subject starts from a different underlying level, but the fixed effects describe the common population pattern.

If the random intercept has variance \(\sigma_b^2\), then two observations from the same subject share the random intercept. Even if the residual errors are independent, this creates positive within-subject correlation.

\[ \operatorname{Cov}(Y_{it},Y_{is})=\sigma_b^2,\qquad t\ne s \]

Under a random-intercept model with independent residual errors, the corresponding intraclass correlation is:

\[ \operatorname{ICC}=\frac{\sigma_b^2}{\sigma_b^2+\sigma_\varepsilon^2} \]

A larger ICC means a greater proportion of the total variability is attributable to persistent differences between subjects.

Random Slopes: Subjects Can Change Differently

A random intercept allows participants to have different levels. A random slope additionally allows them to have different trajectories over time:

\[ Y_{it}=\beta_0+\beta_1t_{it}+b_{0i}+b_{1i}t_{it}+\varepsilon_{it} \]

Now \(b_{1i}\) represents subject \(i\)'s deviation from the average time trend.

For example, one patient may improve rapidly, another may improve slowly, and another may deteriorate. A random-slope model allows these trajectories to vary.

The random effects are often modeled jointly:

\[ \begin{pmatrix}b_{0i}\\b_{1i}\end{pmatrix} \sim N\left[ \begin{pmatrix}0\\0\end{pmatrix}, \begin{pmatrix} \sigma_0^2 & \sigma_{01}\\ \sigma_{01} & \sigma_1^2 \end{pmatrix} \right] \]

The covariance \(\sigma_{01}\) describes whether participants with higher-than-average baseline values tend to have higher or lower-than-average slopes.

Time Should Usually Be Treated Carefully

Longitudinal time can be represented in several ways. The choice changes the scientific question being asked.

Time representationWhat it assumesTypical use
Continuous numeric timeA functional relationship with timeApproximately linear trajectories
Categorical visitNo particular shape across visitsClinical trials with scheduled visits
Polynomial termsA smooth nonlinear trajectoryCurved time trends
Spline termsFlexible nonlinear trajectoryComplex longitudinal patterns

In many confirmatory clinical trials, visit is modeled as a categorical fixed effect because it avoids imposing a linear trajectory that may not be clinically justified.

Treatment, Visit, and Treatment-by-Visit Interaction

A common clinical-trial model contains treatment, visit, and their interaction:

\[ Y_{it} = \beta_0 +\beta_1\operatorname{Treatment}_i +\beta_2\operatorname{Visit}_{it} +\beta_3(\operatorname{Treatment}_i\times\operatorname{Visit}_{it}) +b_{0i} +\varepsilon_{it} \]

The treatment-by-visit interaction is often the most important part of the model when the treatment effect is expected to change over time.

Clinical interpretation: If the interaction is included, the treatment effect at a particular visit is not necessarily equal to the main treatment coefficient. The appropriate treatment contrast must be evaluated at the visit of interest.

A Worked Clinical Trial Example

Consider a randomized trial comparing an active treatment with placebo. The primary continuous endpoint is measured at baseline and Weeks 4, 8, and 12. The scientific question is the difference between treatments at Week 12, adjusted for baseline.

Design featureExample
PopulationAdults randomized 1:1
TreatmentActive vs placebo
OutcomeContinuous clinical score
Post-baseline visitsWeeks 4, 8, 12
Primary contrastActive − placebo at Week 12
CovariateBaseline outcome

A reasonable model could include baseline outcome as a covariate, categorical visit, treatment, treatment-by-visit interaction, and a subject-level random intercept.

Why Baseline Adjustment Matters

Baseline is often strongly associated with subsequent measurements. Including baseline can improve precision and account for chance baseline imbalance.

A typical post-baseline model is conceptually:

\[ Y_{it} = \beta_0 +\beta_1Y_{i,\mathrm{baseline}} +\beta_2\operatorname{Treatment}_i +\beta_3\operatorname{Visit}_{it} +\beta_4(\operatorname{Treatment}_i\times\operatorname{Visit}_{it}) +b_{0i} +\varepsilon_{it} \]

The baseline coefficient \(\beta_1\) measures the association between baseline status and post-baseline outcome, while the treatment-by-visit terms define how the treatment difference evolves across follow-up.

Covariance Structures

The covariance structure determines how repeated observations within a participant are related after accounting for the fixed and random effects. Common choices include:

StructureMain assumptionStrengthLimitation
IndependentNo residual correlationSimpleOften unrealistic for longitudinal data
Compound symmetry (CS)Common variance and common covarianceParsimoniousCorrelation does not depend on time separation
AR(1)Correlation declines with lagNatural for equally spaced visitsLess suitable when visit spacing is irregular or correlation is not monotone
Unstructured (UN)Each variance and covariance is estimatedFlexibleMany parameters
ToeplitzCovariance depends on lag, without AR(1)'s geometric restrictionFlexible lag-based modelMore parameters than AR(1)

There is no universally correct covariance structure. The choice should reflect the design, measurement schedule, scientific understanding, model diagnostics, and prespecified analysis strategy.

Compound Symmetry

Under compound symmetry, all measurements have a common variance and every pair of distinct measurements has the same covariance:

\[ R_i= \begin{pmatrix} \sigma^2 & \rho\sigma^2 & \cdots & \rho\sigma^2\\ \rho\sigma^2 & \sigma^2 & \cdots & \rho\sigma^2\\ \vdots & \vdots & \ddots & \vdots\\ \rho\sigma^2 & \rho\sigma^2 & \cdots & \sigma^2 \end{pmatrix} \]

This can be reasonable when measurements are exchangeable, but it may be restrictive when observations that are close in time are expected to be more strongly correlated.

Autoregressive AR(1)

For equally spaced visits, AR(1) assumes that correlation declines geometrically with the time lag:

\[ \operatorname{Corr}(Y_{it},Y_{is})=\rho^{|t-s|} \]

Thus adjacent visits have correlation \(\rho\), visits two lags apart have correlation \(\rho^2\), and so on.

Important: AR(1) is a model assumption, not a rule that longitudinal data must follow. If visits are not equally spaced, a continuous-time correlation model may be more appropriate than a discrete AR(1) structure.

Unstructured Covariance

An unstructured covariance matrix estimates a separate variance for each visit and a separate covariance for each pair of visits. For four visits:

\[ R= \begin{pmatrix} \sigma_1^2 & \sigma_{12} & \sigma_{13} & \sigma_{14}\\ \sigma_{12} & \sigma_2^2 & \sigma_{23} & \sigma_{24}\\ \sigma_{13} & \sigma_{23} & \sigma_{3}^2 & \sigma_{34}\\ \sigma_{14} & \sigma_{24} & \sigma_{34} & \sigma_4^2 \end{pmatrix} \]

UN is highly flexible and is frequently considered in clinical-trial repeated-measures analyses when the number of scheduled visits is modest. Its price is a larger number of covariance parameters and potentially unstable estimation in smaller datasets.

Random Effects and Covariance Are Not the Same Thing

A common source of confusion is the relationship between random effects and residual covariance.

A random intercept itself induces within-subject correlation. A model can therefore contain both a random intercept and a residual covariance structure, but this should be done intentionally rather than automatically.

Conceptually:

1
Fixed effects: describe the expected mean trajectory or treatment differences.
2
Random effects: allow subjects to have individual deviations such as different baselines or slopes.
3
Residual covariance: describes remaining dependence among repeated observations after the random effects are accounted for.

Maximum Likelihood vs. REML

Mixed models are commonly estimated using either maximum likelihood (ML) or restricted maximum likelihood (REML).

REML accounts for the loss of degrees of freedom associated with estimating fixed effects and is often preferred for estimating variance components when comparing models with the same fixed-effects structure.

ML is generally used when comparing models that differ in their fixed effects because likelihood comparisons need to be based on a common likelihood framework for the fixed-effect specification.

Practical rule: For variance/covariance model comparisons with the same fixed effects, REML is commonly used. For comparisons involving different fixed effects, ML is generally appropriate. The final inferential strategy should follow the prespecified analysis plan.

Interpreting Fixed Effects

Suppose treatment is coded 1 for active and 0 for placebo and visit is categorical. The treatment coefficient at the reference visit represents the treatment difference at that reference visit. The interaction coefficients describe how that treatment difference changes at other visits.

For example, if Week 12 is represented by an indicator and the estimated treatment-by-Week-12 interaction is \(-4.2\), that coefficient contributes to the active-versus-placebo contrast at Week 12. It should not automatically be interpreted as the entire Week-12 treatment effect unless the model parameterization makes it so.

Best practice: In a clinical trial, report the estimated treatment contrast at the clinically relevant visit with its confidence interval and p-value rather than asking clinicians to reconstruct the contrast from individual regression coefficients.

Estimated Marginal Means

Estimated marginal means (EMMs), also called least-squares means in some software, are model-based means or contrasts evaluated at specified covariate settings. They are particularly useful when a treatment-by-visit interaction is present.

For a two-arm trial, the key result may be:

VisitActive adjusted meanPlacebo adjusted meanDifference95% CIP-value
Week 464.867.1−2.3(−4.8, 0.2)0.071
Week 861.266.0−4.8(−7.3, −2.3)<0.001
Week 1258.565.1−6.6(−9.2, −4.0)<0.001

The table is usually much more clinically interpretable than a list of raw model coefficients.

Handling Unequal Numbers of Observations

One major advantage of mixed models is that they can use participants with incomplete longitudinal records without requiring every participant to have the same number of observations.

For example, if a participant has baseline, Week 4, and Week 8 measurements but misses Week 12, the observed data can still contribute to the likelihood under the fitted model.

But missing data are not automatically solved: The validity of likelihood-based mixed-model inference depends on assumptions about the missing-data mechanism. A common assumption is missing at random (MAR), conditional on observed information included in the model.

Missing at Random in Plain Language

MAR does not mean that missingness is unrelated to everything. It means that, after conditioning on relevant observed information, the probability of missingness does not depend on the unobserved value itself.

For example, if patients with poor observed Week 4 outcomes are more likely to miss Week 12, including Week 4 outcome in the analysis model may help make the MAR assumption more plausible.

MAR is an assumption that should be considered and supported through the study's data-collection and sensitivity-analysis strategy; it cannot be proven from the observed data alone.

Model Diagnostics

Mixed models still require assessment of whether the chosen mean and covariance structures are reasonable.

  • Inspect residual distributions and identify influential observations.
  • Assess whether residual variance changes over time or across treatment groups.
  • Consider whether the assumed covariance structure adequately captures within-subject dependence.
  • Check whether a linear time specification is plausible if time is modeled continuously.
  • Examine random-effect estimates cautiously, especially when the number of subjects is small.
  • Evaluate convergence warnings and boundary estimates rather than treating software output as automatically valid.
Do not over-rely on normality tests. With moderate or large clinical-trial samples, graphical diagnostics and assessment of the impact of assumptions are often more informative than a formal test of residual normality.

Model Convergence

A mixed model can fail to converge when the covariance structure is too complex for the available data, parameters are weakly identified, or the optimization problem is difficult.

Common warning signs include:

  • Nonconvergence or optimizer failure.
  • Estimated variances essentially equal to zero.
  • Correlations at or extremely close to \(\pm1\).
  • Very large standard errors.
  • Different optimizers producing materially different solutions.

A convergence warning should never be handled simply by hiding the warning. Investigate the model, simplify the random-effects or covariance structure when scientifically justified, and document the final specification.

Random-Effects Selection

A random intercept is often a natural starting point for repeated subject-level measurements. A random slope can be valuable when subjects plausibly have different rates of change, but it introduces additional variance and covariance parameters.

Adding random effects solely because they improve an information criterion can be problematic. The random-effects structure should have a scientific rationale and should be supported by the data.

Fixed Effects vs. Random Effects: A Clinical Example

VariablePossible roleReason
TreatmentFixedSpecific treatment groups are of scientific interest
VisitFixedSpecific scheduled visits are of interest
Treatment × VisitFixedTests/estimates differential longitudinal effects
SubjectRandomSubjects represent a sampled population
Subject-specific interceptRandomAccounts for persistent subject heterogeneity
Subject-specific slopeRandom, if justifiedAllows heterogeneous trajectories

R Implementation with lme4

The following example uses lme4 for a random-intercept model with categorical visit and a treatment-by-visit interaction.

library(lme4)

fit <- lmer(
  outcome ~ baseline + treatment * visit + (1 | subject),
  data = dat,
  REML = TRUE
)

summary(fit)

A random-intercept and random-slope model can be specified as:

fit_rs <- lmer(
  outcome ~ baseline + treatment * visit +
    (1 + time | subject),
  data = dat,
  REML = TRUE
)

summary(fit_rs)

The syntax (1 + time | subject) allows a subject-specific intercept, a subject-specific time slope, and their covariance.

R Implementation with nlme

The nlme package is particularly useful when you want explicit control over residual correlation and variance structures.

library(nlme)

fit_ar1 <- lme(
  outcome ~ baseline + treatment * visit,
  random = ~ 1 | subject,
  correlation = corAR1(form = ~ time | subject),
  data = dat,
  method = "REML"
)

summary(fit_ar1)

For example, an unstructured random-effects covariance can be represented through the random-effects specification, while residual correlation can be specified separately. This separation is one reason nlme is useful for advanced longitudinal modeling.

SAS Implementation with PROC MIXED

In SAS, PROC MIXED is a standard procedure for linear mixed models.

proc mixed data=dat method=reml;
    class subject treatment visit;

    model outcome =
        baseline
        treatment
        visit
        treatment*visit
        / solution ddfm=kr;

    random intercept / subject=subject;

    lsmeans treatment*visit
        / diff cl;

run;

The DDFM=KR option requests the Kenward–Roger denominator degrees-of-freedom approach, which is commonly used in clinical-trial mixed-model analyses when appropriate.

SAS Residual Covariance Structures

For a residual repeated-measures covariance model, SAS can use the REPEATED statement. For example:

proc mixed data=dat method=reml;
    class subject treatment visit;

    model outcome =
        baseline
        treatment
        visit
        treatment*visit
        / solution ddfm=kr;

    repeated visit / subject=subject type=un;

    lsmeans treatment*visit
        / diff cl;

run;

For AR(1), replace TYPE=UN with TYPE=AR(1). For compound symmetry, use TYPE=CS.

Random-Effects Model vs. Repeated-Covariance Model

There are two closely related ways to formulate longitudinal mixed models.

ApproachTypical formulationConceptual emphasis
Random-effects modelRandom intercept/slopeSubject-specific trajectories
Repeated covariance modelResidual covariance such as UN, CS, AR(1)Within-subject covariance directly
Combined modelRandom effects + residual covarianceBoth subject heterogeneity and residual dependence

These formulations can produce similar marginal covariance patterns in some settings, but they are not interchangeable in every model. The correct specification depends on the scientific estimand and the assumed data-generating process.

Marginal vs. Subject-Specific Interpretation

A mixed model with random effects can support subject-specific interpretations, but many clinical-trial treatment effects are ultimately presented as population-level estimated marginal means and contrasts.

This distinction matters because a random-effects model is not automatically a statement that the clinical treatment effect should be interpreted for an individual patient. The reporting estimand should be defined independently of the software's model syntax.

Degrees of Freedom and Small-Sample Inference

Mixed models do not generally have a single obvious residual degrees of freedom like ordinary linear regression. Different approximations can be used, including residual, Satterthwaite, and Kenward–Roger methods.

For clinical-trial inference, the denominator degrees-of-freedom method should be selected deliberately and prespecified where appropriate.

Practical point: The covariance estimator and the denominator degrees-of-freedom method are separate modeling decisions. Reporting one without the other does not completely describe the inferential procedure.

Likelihood Ratio Tests and Information Criteria

Likelihood ratio tests can be useful for comparing nested covariance or random-effects models, subject to the usual boundary and estimation considerations. Information criteria such as AIC and BIC can also help compare competing specifications.

Model selection should not be driven exclusively by an automated criterion. Clinical interpretability, convergence, parameter stability, design considerations, and prespecified analysis rules matter as well.

What Is the Primary Treatment Effect?

Suppose the protocol defines the primary endpoint as the treatment difference at Week 12. Then the model should produce a direct Week-12 treatment contrast.

Conceptually, if \(\mu_{A,12}\) is the adjusted mean for active treatment at Week 12 and \(\mu_{P,12}\) is the corresponding placebo mean, the estimand is:

\[ \Delta_{12}=\mu_{A,12}-\mu_{P,12} \]

The corresponding estimate, confidence interval, and p-value should be reported directly. This is preferable to reporting a coefficient whose interpretation depends on the reference coding of visit.

What Does the Random Intercept Mean?

The random intercept is not simply "baseline." It represents an unobserved subject-specific deviation from the population intercept under the model. If baseline is included as an observed covariate, the random intercept remains a separate model component.

This distinction is especially important when explaining a model to programmers or clinicians: baseline is an observed measurement; a random intercept is a latent subject-specific model parameter.

What Does the Random Slope Mean?

A random slope means that the rate of change associated with time varies among subjects. If the estimated random-slope variance is large, subjects have heterogeneous trajectories around the population-average trajectory.

However, random-slope estimates should not be interpreted as directly observed individual treatment effects. They are estimated components of the hierarchical model.

Prediction vs. Inference

Mixed models can be used both to estimate population-level effects and to predict subject-specific random effects. These are different goals.

GoalTypical quantityExample
Population inferenceFixed-effect contrastActive − placebo at Week 12
Mean trajectoryEstimated marginal meanAdjusted mean at Week 8
Subject predictionConditional random effectEstimated patient's deviation from average trajectory

Common Mistakes

  1. Treating repeated observations as independent. This ignores the defining feature of longitudinal data.
  2. Interpreting the treatment main effect as the treatment effect at every visit. With a treatment-by-visit interaction, treatment effects depend on visit.
  3. Using continuous time without checking the trajectory. A linear time effect can be too restrictive.
  4. Adding a random slope automatically. More complexity is not always better.
  5. Ignoring covariance structure. The within-subject covariance is central to inference.
  6. Ignoring convergence warnings. A numerical warning can indicate an inadequately identified model.
  7. Comparing fixed-effects models using REML. ML is generally used when the fixed-effects structure changes.
  8. Assuming mixed models eliminate missing-data bias. They provide likelihood-based inference under assumptions such as MAR; they do not make missingness irrelevant.
  9. Reporting only model coefficients. Clinical reports should emphasize the prespecified estimand and corresponding treatment contrast.
  10. Choosing a covariance structure after seeing the primary result. Covariance selection should be prespecified or handled according to a clearly defined modeling strategy.

A Practical Longitudinal Modeling Workflow

1
Define the longitudinal endpoint and the primary treatment estimand.
2
Identify the repeated-measure unit, usually subject, and verify the analysis dataset structure.
3
Specify clinically important fixed effects such as treatment, visit, baseline, and treatment × visit.
4
Choose a random-effects structure with a scientific rationale.
5
Specify a residual covariance structure appropriate to the visit schedule and data.
6
Fit the model using an appropriate estimation method such as REML.
7
Check convergence, variance estimates, residual behavior, and covariance-model adequacy.
8
Obtain the prespecified treatment contrast at the primary visit.
9
Report the estimate, confidence interval, standard error, and p-value with the model specification.
10
Perform sensitivity analyses for important departures from the primary assumptions, especially missing-data assumptions.

What Should Be Reported in a Statistical Analysis Plan?

A reproducible SAP section for an LMM should specify the analysis population, endpoint definition, timing of measurements, fixed-effects structure, covariance/random-effects structure, estimation method, degrees-of-freedom method, contrast of interest, and missing-data strategy.

  • Outcome definition and units
  • Analysis population
  • Baseline adjustment
  • Treatment and visit coding
  • Treatment-by-visit interaction
  • Random-effects specification, if used
  • Residual covariance structure
  • Estimation method (ML or REML)
  • Denominator degrees-of-freedom method
  • Primary treatment contrast and confidence interval
  • Multiplicity strategy, if multiple contrasts are tested
  • Handling of missing and post-baseline data
  • Sensitivity analyses
  • Software and version

How to Think About the Model in One Equation

The most useful mental model is:

\[ \text{Observed outcome} = \text{population mean structure} + \text{subject-specific deviation} + \text{remaining within-subject error} \]

In symbols:

\[ Y_{it} = \underbrace{X_{it}^{\mathsf T}\beta}_{\text{fixed effects}} + \underbrace{Z_{it}^{\mathsf T}b_i}_{\text{random effects}} + \underbrace{\varepsilon_{it}}_{\text{residual}} \]

This decomposition explains why mixed models are so useful: they do not force all participants to follow exactly the same trajectory, but they also do not treat each measurement as an unrelated observation.

Worked Interpretation

Suppose the fitted model estimates a Week-12 active-versus-placebo difference of \(-6.6\) units with a 95% confidence interval of \((-9.2,-4.0)\).

A clinically appropriate interpretation is:

Interpretation: After accounting for the prespecified covariates and longitudinal covariance structure, the estimated mean outcome at Week 12 was 6.6 units lower in the active-treatment group than in the placebo group. The 95% confidence interval for the treatment difference was 4.0 to 9.2 units lower.

The interpretation should be tied to the endpoint's clinical direction. A lower value is not automatically better; the meaning depends on what the outcome measures.

When Linear Mixed Models Are Appropriate

LMMs are especially useful when:

  • The outcome is approximately continuous.
  • The same subjects are measured repeatedly.
  • The mean trajectory can be described adequately by the chosen fixed-effects structure.
  • Within-subject covariance is important.
  • Incomplete repeated measurements occur and a likelihood-based analysis under a defensible missing-data assumption is appropriate.

When a Different Model May Be Better

An LMM is not a universal solution.

Outcome/data featurePotential alternative
Binary repeated outcomeGeneralized linear mixed model
Count outcomePoisson or negative-binomial mixed model
Strongly non-Gaussian continuous outcomeTransformation or another appropriate model
Time-to-event endpointSurvival analysis / mixed-effects survival methods where appropriate
Highly nonlinear trajectoryNonlinear mixed model or flexible spline-based model
Ordinal repeated outcomeOrdinal mixed model

The endpoint scale and scientific estimand should drive model selection.

Bottom Line

Bottom line: Linear mixed effects models provide a flexible framework for longitudinal continuous outcomes by combining fixed effects for population-level scientific questions with random effects and/or covariance structures for within-subject dependence. In clinical trials, the key is not merely to fit a mixed model, but to prespecify a clinically meaningful estimand, model treatment and time appropriately, choose a defensible covariance structure, handle missing data under explicit assumptions, and report the treatment contrast directly at the visit of interest.

References

Laird, N.M. & Ware, J.H. (1982). Random-effects models for longitudinal data. Biometrics, 38(4), 963–974.
Verbeke, G. & Molenberghs, G. (2000). Linear Mixed Models for Longitudinal Data. Springer.
Fitzmaurice, G.M., Laird, N.M. & Ware, J.H. (2011). Applied Longitudinal Analysis. Wiley.
Pinheiro, J.C. & Bates, D.M. (2000). Mixed-Effects Models in S and S-PLUS. Springer.
West, B.T., Welch, K.B. & Galecki, A.T. (2015). Linear Mixed Models: A Step-by-Step Approach. CRC Press.
Kenward, M.G. & Roger, J.H. (1997). Small sample inference for fixed effects from restricted maximum likelihood. Biometrics, 53, 983–997.

Clinical Trials

See mixed-effects model in real clinical trials

See the method applied to published trial results, with the estimates, confidence intervals and interpretation explained.

GALACTIC-HF
Independent statistical analysis of GALACTIC-HF, the randomized phase 3 trial of omecamtiv mecarbil in chronic heart failure with reduced ejection fraction, including…
Phase 3 · n = 8,256
FINEARTS-HF
Independent statistical analysis of FINEARTS-HF, the randomized phase 3 trial evaluating finerenone versus placebo in participants with heart failure and left ventricular…
Phase 3 · n = 6,016
Partners PrEP
An independent statistical analysis of the Partners PrEP phase 3 trial, examining TDF and FTC/TDF for prevention of HIV-1 acquisition in HIV-1…
Phase 3 · n = 4,758
iPrEx
Independent statistical analysis of the randomized phase 3 iPrEx trial of daily TDF/FTC versus placebo for HIV prevention in men, including primary…
Phase 3 · n = 2,499
EXPEDITION 3
Independent statistical analysis of EXPEDITION 3 (NCT01900665), a randomized phase 3 trial comparing solanezumab with placebo in participants with mild Alzheimer's disease,…
Phase 3 · n = 2,129
SURPASS-4
Independent statistical analysis of SURPASS-4, a randomized phase 3 trial of once-weekly tirzepatide versus once-daily insulin glargine in participants with type 2…
Phase 3 · n = 2,002
See all 35 trials using mixed-effects model →