Tutorials › Nonlinear Mixed-Effects Models (NLME) › Residuals Against Population Predictions

Goodness-of-Fit Diagnostics and Their Pitfalls · Tutorial 544 of 797

Residuals Against Population Predictions

Learn to interpret residuals across the range of population predictions while separating model patterns from artifacts caused by different sampling schedules.

Intermediate 11 min read

What You'll Learn

  • Define population predictions and residuals for a prediction-versus-residual diagnostic.
  • Recognize trends in residual location and changes in residual spread across prediction levels.
  • Distinguish patterns in raw residuals from those in appropriately standardized residuals.
  • Explain how differing sampling schedules can create a misleading pooled trend.
  • Use stratification and schedule-aware checks to investigate an apparent pattern.
  • Identify the limits of this diagnostic and avoid treating a visual pattern as proof of a specific model defect.

Why Plot Residuals Against Population Predictions?

A residual plotted against its population prediction asks whether model errors behave differently at low and high predicted responses. This complements a plot against time since dose: time can reveal a pattern tied to dose history, while population prediction can reveal a pattern tied to the response range. A systematic shift in residual location may indicate prediction-dependent bias; a change in residual spread may indicate that variability is not being represented comparably across that range.

The plot is a diagnostic, not a test that identifies one unique cause. A curve can arise from a misspecified structural model, an unsuitable residual-error model, an omitted design feature, or a changing mix of subjects and sampling schedules. The interpretation therefore depends on what prediction was plotted, which residual was used, and how the observations were collected.

Definition: Let \(y_{ij}\) be the observed response for subject \(i\) at observation \(j\), and let \(\widehat y^{POP}_{ij}\) be the model's population prediction for that observation. The raw residual is \(e^{POP}_{ij}=y_{ij}-\widehat y^{POP}_{ij}\). A residuals-against-population-predictions plot places \(\widehat y^{POP}_{ij}\) on the horizontal axis and a chosen residual on the vertical axis.

The population prediction uses population-level parameter estimates and the observation's relevant design and covariate information; it does not use that subject's estimated individual random effects. Software conventions differ. In particular, some population predictions use the typical subject (random effects set to zero), while a marginal population prediction averages over the random-effects distribution. In a nonlinear model, those are not generally the same quantity. State which prediction is being used and follow the software's definition consistently.

Residual choice also matters. A raw residual is in the response's units, such as mg/L, and is useful for describing absolute discrepancies. A weighted or standardized residual accounts for a model-based prediction variance and is more suitable for comparing relative discrepancies across the prediction range, provided that the variance used for standardization is appropriate. The earlier material on raw, weighted, and conditional residuals and on standardizing residuals with prediction variance gives the distinctions. Do not switch residual definitions midway through an interpretation.

What Patterns Are Informative?

If the population prediction adequately describes the mean response over the observations being compared, residuals should be centered near zero across the prediction range. A sustained positive or negative trend, or a systematic curve, suggests that the model tends to underpredict or overpredict in some part of that range. Because residuals are observed minus predicted, positive residuals mean observations exceed predictions; negative residuals mean observations fall below predictions.

Spread must be interpreted in relation to the residual scale. Raw residuals can have greater absolute spread at higher predictions when the modeled response variance itself increases with the mean. That may be consistent with the assumed error model rather than evidence of a defect. For standardized residuals, a marked increase or decrease in spread suggests that the standardized variability may not be stable across prediction levels. This plot can flag such a pattern, but a detailed assessment of heteroscedasticity requires other diagnostics as well.

A useful reference is a horizontal line at zero, together with a smooth trend or grouped summaries that do not conceal individual observations. Look for a sustained departure, curvature, or a change in spread rather than treating one isolated residual as decisive. A smooth line is a descriptive aid: its shape depends on the data density and smoothing choices, and it does not establish a formal significance level.

Worked Example: A Prediction-Dependent Mean Pattern

Suppose a hypothetical concentration data set uses population predictions in mg/L. At three prediction levels, the observations and raw residuals are as follows.

Population prediction (mg/L)Observed concentrations (mg/L)Raw residuals (mg/L)Mean residual (mg/L)
22.4, 2.60.4, 0.60.5
55.1, 4.90.1, -0.10
108.8, 9.2-1.2, -0.8-1.0

For example, at a prediction of 2 mg/L, the residuals are \(2.4-2=0.4\) mg/L and \(2.6-2=0.6\) mg/L. Their mean is \((0.4+0.6)/2=0.5\) mg/L. At 10 mg/L, the mean is \((-1.2-0.8)/2=-1.0\) mg/L. The grouped means decline from 0.5 to 0 to -1.0 mg/L.

The low predictions are underestimates on average, while the high predictions are overestimates on average. This is evidence of prediction-dependent mean structure in these hypothetical observations. It does not by itself identify the cause or establish that the pattern would persist in another sample. The small number of observations per level makes the summaries especially uncertain.

Why Pooling Sampling Schedules Can Mislead

Different subjects may contribute observations at different times or under different sampling schedules. Since prediction values are tied to time, dose history, and covariates, the observations at one prediction level may come mostly from one schedule, while observations at another level come mostly from a different schedule. A pooled residual trend can then reflect the changing composition of schedules rather than a trend that occurs within each schedule.

The issue can be expressed with conditional expectations. Let \(S\) denote sampling schedule and \(P\) denote the population-prediction value or prediction range. The pooled mean residual is

$$ E(e^{POP}\mid P) = \sum_s E(e^{POP}\mid P,S=s)\,P(S=s\mid P). $$

Even if the schedule-specific mean residual does not change with prediction, the pooled mean can change when the schedule weights \(P(S=s\mid P)\) change across prediction levels. Thus, an overall pattern need not represent a within-schedule prediction-dependent bias.

Worked Example: A Pooled Trend Created by Schedule Mix

Consider a hypothetical study with two sampling schedules. At each prediction level, observations from schedule A have a mean residual of \(+2\) mg/L, and observations from schedule B have a mean residual of \(-2\) mg/L. These schedule-specific means are constant across the prediction levels. The numbers of observations are:

Population prediction (mg/L)Schedule A countSchedule B countPooled mean residual (mg/L)
2821.2
4640.4
828-1.2

At 2 mg/L, the pooled mean is \(\{8(2)+2(-2)\}/10=(16-4)/10=1.2\) mg/L. At 4 mg/L, it is \(\{6(2)+4(-2)\}/10=(12-8)/10=0.4\) mg/L. At 8 mg/L, it is \(\{2(2)+8(-2)\}/10=(4-16)/10=-1.2\) mg/L.

The pooled summaries show a decreasing pattern, even though neither schedule's mean residual changes with prediction in this example. The schedule composition changes: low predictions are mostly from A, and high predictions are mostly from B. A plot that ignores schedule could therefore suggest a prediction-dependent bias that is not present within either schedule. The appropriate next step is to inspect the schedules separately or otherwise account for schedule, not to conclude from the pooled plot alone that one particular model component is wrong.

A Short Justification for Checking Schedule-Stratified Patterns

The pooling effect follows from the law of total variance as well as from the conditional-mean identity above. For residuals at a given prediction level, variation in the pooled group can include both variation within schedules and variation between their mean residuals:

$$ \operatorname{Var}(e^{POP}\mid P) = E\{\operatorname{Var}(e^{POP}\mid P,S)\mid P\} + \operatorname{Var}\{E(e^{POP}\mid P,S)\mid P\}. $$

The first term is the average within-schedule variance. The second is the variance among schedule-specific mean residuals, weighted by the schedules represented at that prediction level. It is nonnegative and can contribute to pooled spread even when within-schedule spreads are unchanged. This identity justifies checking both location and spread by schedule when the schedule mix varies across the prediction axis.

1
Confirm the plotted quantities.
Check whether the horizontal axis is a typical-subject or marginal population prediction, and identify whether the vertical axis is raw, weighted, or standardized.
2
Describe the pooled pattern.
Assess residual centering, sustained trend or curvature, and spread across the prediction range. Record whether the pattern concerns raw or standardized residuals.
3
Check the observation mix.
Compare schedules and other relevant design features across prediction levels. If composition changes substantially, examine the pattern within those groups.
4
Interpret cautiously.
Decide what model assessment is warranted only after considering sparse regions, influential observations, prediction conventions, and other diagnostics.

Checking Spread Without Confusing Scales

For raw residuals, a widening band can be expected if the response variance increases with the predicted mean under the assumed residual-error model. For a properly standardized residual, whose scale accounts for the relevant prediction variance, a systematic widening is more concerning. These are different claims: the first concerns absolute error in response units, while the second concerns error relative to its modeled scale.

Worked Example: Comparing Standardized Residual Spread

Suppose a hypothetical diagnostic uses standardized residuals. In a low-prediction group, four values are \(-0.5, 0, 0.5, 0\). Their mean is 0, and their sample standard deviation is \(s=\sqrt{\{(-0.5)^2+0^2+(0.5)^2+0^2\}/(4-1)}=\sqrt{0.5/3}=0.408\).

In a high-prediction group, four values are \(-2, 0, 2, 0\). Their mean is also 0, but their sample standard deviation is \(s=\sqrt{\{(-2)^2+0^2+2^2+0^2\}/(4-1)}=\sqrt{8/3}=1.633\).

Both groups are centered at zero, but the observed standardized spread is substantially larger in the high-prediction group. This is a reason to investigate whether the prediction-variance standardization or model is adequate in that region. With only four values per group, these standard deviations are imprecise; they are descriptive evidence, not a definitive test.

Alternatives, Limitations, and Common Pitfalls

A residuals-against-population-predictions plot is most useful as one view among several. A plot against time since dose focuses on temporal structure; it can reveal time-related patterns that are not obvious from prediction level alone. A schedule-stratified version of the current plot addresses the pooling problem directly. A residuals-against-individual-predictions plot uses subject-specific predictions instead, but answers a different question and should not be substituted without recognizing that change in prediction target. Observed-versus-predicted plots compare the scale of observations and predictions directly rather than centering their difference at zero. None of these views alone identifies a unique model correction.

A further limitation is that observations from the same subject are not generally independent. A cloud of many points can look persuasive even if most points come from a few subjects or a single schedule. Sparse prediction ranges can also make smooth trends unstable. Examine the data distribution and subject or schedule composition, and use complementary diagnostics rather than relying on a visual trend alone.

  • Mistake: “The residuals widen at high predictions, so the model is wrong.” This conclusion ignores scale. Raw residual spread may increase under a response-variance model that allows variance to grow with the mean. Check standardized residuals and the assumed variance before judging the pattern.
  • Mistake: “The pooled residual trend proves bias at high predictions.” A changing mix of schedules can generate the pooled trend. Check schedule-specific patterns before attributing it to prediction level.
  • Mistake: “Every residual should be close to zero.” Individual residuals vary by chance. The diagnostic concerns systematic location or spread patterns, not whether each point equals zero.
  • Mistake: “A trend tells us which model term to change.” A trend flags a possible lack of fit; it does not distinguish structural, variance, covariate, or design-related explanations by itself.
Key takeaway: Read residuals against population predictions as a check for prediction-related patterns, not as a stand-alone verdict. Interpret the residual scale correctly, inspect changing schedule composition, and confirm any suspected pattern with complementary diagnostics.

Check Your Understanding

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

  1. If a raw residual is \(-0.8\) mg/L, what does its sign say about the observed concentration relative to its population prediction?
  2. Why can a pooled prediction-related trend occur even when schedule-specific mean residuals are constant across prediction levels?
  3. A raw-residual plot widens at high predictions, but the residual-error model allows variance to increase with the mean. What should be checked before calling the pattern a defect?
  4. What does a pattern of standardized residuals with means near zero but increasing spread suggest, and why should it be interpreted cautiously?
  5. Why is a population-prediction residual plot not interchangeable with a residual plot against individual predictions?

Solutions. (1) The observation is 0.8 mg/L below its population prediction, because residual equals observed minus predicted. (2) The schedule weights can change across prediction levels, so averaging different schedule-specific means with changing weights changes the pooled mean. (3) Check whether the raw widening is consistent with the variance model and inspect an appropriately standardized residual; also consider schedule composition. (4) It suggests that residual variability relative to the modeled scale may depend on prediction, but small or unbalanced groups and subject-level dependence can make the visual pattern uncertain. (5) Population predictions do not use subject-specific estimated random effects, whereas individual predictions do; they therefore assess residuals relative to different prediction targets.