Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Population-Average and Subject-Specific Predictions

Mixed Models Review · Tutorial 75 of 697

Population-Average and Subject-Specific Predictions

Learn to calculate and interpret marginal population and subject-specific biomarker predictions from the same linear mixed model.

Intermediate 11 min read

What You'll Learn

  • Define marginal and subject-specific predictions for a Gaussian linear mixed model.
  • Calculate each prediction for a specified biomarker profile.
  • Explain how estimated, shrunken subject effects change a prediction.
  • Distinguish a predicted mean response from a future observed measurement.
  • Identify common interpretation errors and prediction limitations.

Two Prediction Targets From One Model

A longitudinal model can describe both the average biomarker trajectory in a population and how an individual subject’s trajectory differs from that average. Those are related, but not identical, prediction targets. For a population-level question, the relevant prediction averages over subject-to-subject random variation. For a question about a particular subject, the prediction can incorporate that subject’s estimated random effects.

The distinction matters whenever a prediction is reported: the same fixed-effects estimates may produce different answers depending on whether subject effects are included. A prediction for an average member of a population is not necessarily a good prediction for a particular person whose observed biomarker history indicates a departure from the population trajectory.

Definition: For a Gaussian linear mixed model with a linear mean, a marginal population prediction is the expected biomarker value at a specified covariate profile after averaging over the distribution of subject random effects. A subject-specific prediction is the expected biomarker value at that profile conditional on a subject’s random effects; in practice, the unknown effects are replaced by their estimated, typically shrunken, values.

Model and Assumptions

Write the repeated biomarker measurements for subject \(i\) as a vector \(Y_i\). A Gaussian linear mixed model is

$$ Y_i=X_i\beta+Z_i b_i+\varepsilon_i, \qquad b_i\sim N(0,D), \qquad \varepsilon_i\sim N(0,R_i). $$

Here \(X_i\) contains the fixed-effect covariates, \(\beta\) is the vector of fixed-effect coefficients, \(Z_i\) contains the random-effect covariates, \(b_i\) is the subject’s random-effect vector, and \(\varepsilon_i\) is the residual vector. The usual assumptions for this prediction interpretation are that the random effects have mean zero, the residuals have mean zero, and random effects and residuals are independent. The covariance matrices \(D\) and \(R_i\) describe their respective variation. Predictions also rely on the specified mean structure being suitable for the covariate profile of interest.

For one measurement at a specified profile, let \(x\) and \(z\) be the corresponding fixed- and random-effect design vectors. Conditional on the random effect, the expected response is \(x^\mathsf{T}\beta+z^\mathsf{T}b_i\). The population prediction averages this expression over the random-effect distribution. In applications, \(\beta\) is replaced by its estimate \(\hat\beta\); for a subject-specific prediction, \(b_i\) is replaced by its estimated value \(\hat b_i\), often called the empirical BLUP.

Why Averaging Removes the Random-Effect Term

The marginal prediction follows directly from the law of total expectation. First take the conditional expectation of a measurement given the subject effect. Then average that conditional expectation over the random-effect distribution:

$$ \begin{aligned} E(Y\mid x,z,b_i)&=x^\mathsf{T}\beta+z^\mathsf{T}b_i,\\ E(Y\mid x,z) &=E\{E(Y\mid x,z,b_i)\mid x,z\}\\ &=x^\mathsf{T}\beta+z^\mathsf{T}E(b_i)\\ &=x^\mathsf{T}\beta, \end{aligned} $$

The last equality uses \(E(b_i)=0\). Thus the marginal and subject-specific predictions share the same fixed-effects component, but only the subject-specific prediction adds the estimated deviation \(z^\mathsf{T}\hat b_i\). This result depends on the linear mean and identity link. It should not be transferred without adjustment to models with nonlinear links, where averaging over random effects generally does not leave the fixed-effects expression unchanged.

Worked Example: Predicting a Treated Subject’s Biomarker

Suppose a hypothetical model predicts biomarker concentration in milligrams per liter using time in months and treatment status. Its fixed-effects mean is

$$ E(Y_{ij}\mid b_i) =10+0.8t_{ij}-1.5A_i+0.3t_{ij}A_i+b_{0i}+b_{1i}t_{ij}. $$

Here \(A_i=1\) denotes treatment and \(A_i=0\) denotes the comparison group; \(b_{0i}\) and \(b_{1i}\) are the subject’s random intercept and random time slope. For a treated subject at month 4, the population prediction is the fixed-effects part:

$$ 10+(0.8)(4)-1.5+(0.3)(4) =10+3.2-1.5+1.2 =12.9\ \text{mg/L}. $$

Suppose this subject’s estimated random intercept is \(\hat b_{0i}=-2.0\) mg/L and estimated random slope is \(\hat b_{1i}=0.25\) mg/L per month. The estimated subject deviation at month 4 is

$$ \hat b_{0i}+\hat b_{1i}(4)=-2.0+1.0=-1.0\ \text{mg/L}. $$

The subject-specific prediction is therefore \(12.9-1.0=11.9\) mg/L. The population prediction describes the model’s average at this treated, month-4 profile; the subject-specific prediction is lower because this subject’s estimated trajectory is below that average at month 4. Neither number is a causal effect of treatment by itself.

Calculating Predictions for a Profile

To calculate either prediction, first specify the profile completely: time, treatment group, and any other fixed covariates in the model. Then calculate the fixed-effects part. For the marginal prediction, stop there. For the subject-specific prediction, calculate the random-effects contribution using that profile’s random-effect design vector and the subject’s estimated random effects, then add it to the fixed-effects part.

1
Set the prediction target.
Decide whether the question concerns the population average at a covariate profile or a particular subject’s expected response.
2
Evaluate the fixed-effects mean.
Substitute the specified covariates into \(x^\mathsf{T}\hat\beta\). This is the marginal population prediction in the Gaussian linear model.
3
Add a subject deviation only when appropriate.
For subject \(i\), calculate \(z^\mathsf{T}\hat b_i\) at the same profile and add it to the fixed-effects prediction.

Worked Example: Comparing Two Subjects at the Same Time

Consider a hypothetical biomarker model for which the fixed-effects mean in the comparison group is \(20+1.2t\) mg/L, where \(t\) is months since baseline. At month 6, the marginal population prediction is

$$ 20+(1.2)(6)=27.2\ \text{mg/L}. $$

Suppose subject A has estimated random intercept and slope \(\hat b_{0A}=-1.4\) mg/L and \(\hat b_{1A}=0.10\) mg/L per month. Subject A’s estimated deviation at month 6 is \(-1.4+(0.10)(6)=-0.8\) mg/L, so the subject-specific prediction is \(27.2-0.8=26.4\) mg/L.

Suppose subject B has \(\hat b_{0B}=0.8\) mg/L and \(\hat b_{1B}=-0.05\) mg/L per month. The deviation at month 6 is \(0.8+(-0.05)(6)=0.5\) mg/L, giving a subject-specific prediction of \(27.2+0.5=27.7\) mg/L. Both predictions use the same population mean at this profile; their difference comes from the two subjects’ estimated random effects.

The marginal prediction is not required to equal the average of the predictions for these two subjects. These subjects are only a small, selected pair, and their estimated effects need not average to zero. The zero-mean assumption describes the random-effects distribution in the population, not every subset of subjects or every collection of estimated effects.

Predicted Mean Versus Future Measurement

A predicted mean response and a prediction of a future observed measurement are different targets. Under the stated model, the future residual has conditional expectation zero. Therefore, the point prediction for a future observation has the same mean as the corresponding predicted trajectory: \(x^\mathsf{T}\hat\beta\) marginally or \(x^\mathsf{T}\hat\beta+z^\mathsf{T}\hat b_i\) for a subject-specific prediction. But an actual future measurement also includes residual variation, so it will not generally equal that mean.

Worked Example: Subject Trajectory or Future Observation?

Suppose a hypothetical model has a population mean of \(5+2t\) mg/L and, for one subject, estimated random effects \(\hat b_{0i}=1.0\) mg/L and \(\hat b_{1i}=-0.4\) mg/L per month. At month 3, the population prediction is \(5+(2)(3)=11.0\) mg/L. The subject-specific predicted mean is

$$ 11.0+1.0+(-0.4)(3)=10.8\ \text{mg/L}. $$

If a future observed measurement were 12.1 mg/L, its difference from the subject-specific predicted mean would be \(12.1-10.8=1.3\) mg/L. That difference is a possible residual realization; it does not change the model’s predicted mean. A prediction interval for a future measurement must account for residual variability, and generally also for uncertainty in estimated parameters and, where relevant, the estimated subject effect. The point prediction alone is not an interval.

Diagnostics, Comparisons, and Limitations

The main alternative to a subject-specific prediction is the marginal prediction, not a competing fitted model: the two answer different questions using the same model. A fixed-effects-only calculation is appropriate for the population-average target under this Gaussian linear model. Adding estimated random effects is appropriate when the target is a particular subject and those effects have been estimated from that subject’s data. A raw subject average is a different alternative, but it may ignore time, treatment, and shrinkage, and may be unstable with few measurements.

Before interpreting either prediction, check that the profile is represented by the model’s covariates and that the prediction is not an unsupported extrapolation in time or covariate values. Compare the subject-specific estimate with the fixed-effects prediction at the same profile, rather than comparing values at different times or treatment groups. Large subject deviations can be meaningful, but may also prompt examination of data quality, sparse follow-up, or a poorly fitting trajectory. The earlier material on reading shrunk subject trajectories explains why estimated random effects tend to be pulled toward zero, particularly when a subject has limited information.

A common mistake is to add the subject’s estimated random intercept but omit a random slope contribution at a nonzero time, or to add random effects when reporting the population mean. The correction is to use the full random-effects design at the requested profile, \(z^\mathsf{T}\hat b_i\), only for a subject-specific target. Another mistake is to call that plug-in value the subject’s known true trajectory. It is an estimate, and its precision depends on the data and model. Predictions may also be unreliable if the mean structure, random-effects distribution, or residual assumptions are inadequate; conditional predictions do not repair model misspecification.

Key takeaway: In a Gaussian linear mixed model, the marginal prediction is \(x^\mathsf{T}\hat\beta\), while the subject-specific prediction is \(x^\mathsf{T}\hat\beta+z^\mathsf{T}\hat b_i\). State which target you report, specify the covariate profile, and treat estimated subject effects as uncertain estimates rather than known attributes.

Check Your Understanding

Answer each question, then compare your reasoning with the brief solutions.

  1. At a specified profile, what distinguishes the marginal population prediction from a subject-specific prediction?
  2. A model predicts a population mean of 18 mg/L at month 5. A subject has estimated random intercept \(-1\) mg/L and random slope \(0.2\) mg/L per month. Calculate that subject’s predicted mean at month 5.
  3. Must the mean of the predictions for a small group of subjects equal the marginal population prediction? Why or why not?
  4. Under the stated Gaussian linear model, does a future observed measurement have the same value as its predicted mean? Explain.

Solutions. (1) The marginal prediction averages over random effects and uses the fixed-effects mean; the subject-specific prediction adds the subject’s estimated random-effects contribution at the profile. (2) The deviation is \(-1+(0.2)(5)=0\) mg/L, so the subject-specific prediction is \(18+0=18\) mg/L. (3) No. A small group’s estimated effects need not average to zero, even though the random-effects distribution has mean zero. (4) No. The predicted mean is an expectation; a future observation also includes a residual realization, whose conditional expectation is zero but whose realized value need not be zero.

Clinical Biostats