21.12 Residuals versus prediction: finding mean and variance mismatch
Residuals versus PRED or IPRED arrange observations by predicted magnitude. They are especially useful for detecting mean-model curvature and residual-error misspecification. nlmx’s standard panel uses CWRES versus PRED and IWRES versus IPRED.
A horizontal center near zero is desirable. A curved trend suggests that the model underpredicts one range and overpredicts another. A funnel whose vertical spread widens with prediction indicates insufficient scale dependence after weighting; a narrowing funnel indicates too much. Separate bands may represent endpoints, laboratories, studies, formulations, or categorical covariates.
The Chapter 20 CWRES-versus-PRED plot can be compared directly with its IWRES-versus-IPRED plot. The former includes a population covariance adjustment; the latter focuses on the conditional error model. Agreement strengthens the interpretation, while differences warrant examination of random-effects linearization, shrinkage, or influential subjects.

Prediction magnitude may correlate with time, dose, or endpoint. A residual pattern against PRED is therefore not automatically caused by residual variance. Stratify and inspect time plots before changing the error model. Changing additive/proportional components to flatten one plot can distort low-concentration behavior or BLQ treatment.
Use consistent prediction scales. If the model is fitted to log DV, residuals remain on that scale even when DV/PRED figures are back-transformed. Do not combine transformed predictions with untransformed residual definitions in an undocumented custom figure.
Common mistakes
- Diagnosing every funnel as an error-model problem.
- Ignoring correlation between prediction, time, dose, and endpoint.
- Mixing PRED with IWRES or IPRED with an undefined residual convention.
- Choosing an error model solely to flatten one smoother.
- Forgetting the fitted scale after back-transformation.
Checklist
- Review center and spread across the full prediction range.
- Compare CWRES–PRED and IWRES–IPRED.
- Cross-check time, dose, study, and endpoint patterns.
- Inspect low-concentration and BLQ regions deliberately.
- Test error-model changes in controlled reruns.
Further reading
Continue with residual distributions, back-transformation, and Chapter 20’s residual-error parameterizations.