Why Examine Residuals Across Time?
A model prediction is not assessed only by whether its values look close to observed data overall. In a longitudinal prediction, the sequence and structure of deviations matter: errors may be small on average yet consistently too high early and too low late, or they may drift together over successive visits. Such patterns can signal that the model is missing a relevant time-course feature, even when a single summary of overall error appears acceptable.
Residual diagnostics are descriptive checks on predictions and their deviations, not a stand-alone proof that a model is valid or invalid. The intended-use claim and the prediction conditions must be clear, and the validation data must be kept distinct from data used to tune the model. Here, the focus is how to read residual patterns across time and dose while allowing for ordinary measurement variability.
For a QSP biomarker measured in concentration units, a residual of \(2\ \mathrm{ng/mL}\) means the observed concentration was \(2\ \mathrm{ng/mL}\) above the prediction. This sign convention should be kept consistent throughout an analysis. A residual plot puts residual values on one axis and a relevant feature—often time, predicted value, dose, or subject—on the other.
What Patterns to Look For
Start with a plot of residuals against time, using a horizontal reference at zero. If predictions are well centered at each time in the target population, residuals should generally lie on both sides of zero without a persistent time-dependent shift. This is not a demand that every residual be small or that the observed sequence alternate randomly. Rather, it is a check for structure that is too systematic to be explained comfortably as ordinary variation.
- Bias over time: residuals predominantly positive or negative in a time region suggest underprediction or overprediction there. A change from positive early residuals to negative late residuals can indicate that the predicted time course is too slow or too persistent, though the precise mechanism is not identified by the plot alone.
- Temporal dependence: neighboring residuals that tend to share a sign or move together show serial patterning. A run of positive residuals may be more informative than the same number scattered across time. Repeated observations from one subject are not independent replicates.
- Dose dependence: residuals that shift or spread systematically across dose groups suggest that prediction performance differs with dose. Plotting residuals against dose, and separately by time where useful, helps avoid mistaking a time imbalance across dose groups for a dose effect.
- Changing variance: a residual cloud that widens or narrows with time, predicted value, or dose may indicate nonconstant variability. A trend in spread is distinct from a trend in the residual mean.
A plot should preserve the design information. Connecting residuals within a subject can make time ordering visible; different symbols or panels can identify dose groups. When several subjects contribute measurements, show the individual sequences as well as a pooled view where possible. A pooled mean near zero can conceal a positive bias for one dose and a negative bias for another.
Worked Examples
Worked Example: Detecting a Time-Dependent Bias
Suppose a hypothetical validation set contains four observations of a cytokine concentration, in \(\mathrm{pg/mL}\), at one dose. The observed and predicted values are:
| Time (h) | Observed | Predicted | Residual |
|---|---|---|---|
| 1 | 12 | 10 | 2 |
| 2 | 15 | 13 | 2 |
| 4 | 16 | 16 | 0 |
| 8 | 11 | 13 | -2 |
For each row, \(r=y-\hat{y}\). For example, at 1 h, \(r=12-10=2\ \mathrm{pg/mL}\). The mean residual is
The overall mean is close to zero, but it hides the sequence: positive residuals early, then a negative residual late. This pattern is consistent with early underprediction and late overprediction in these observations. Four points cannot establish a general time-course failure, and the plot does not identify its cause, but reporting only the mean residual would miss the direction change.
Worked Example: Recognizing Serial Patterning
Consider six hypothetical, equally spaced measurements from one subject, with residuals in \(\mathrm{ng/mL}\): \(1, 2, 1, 2, 1, 2\). Their mean is
The residuals are all positive, indicating that predictions are below observations throughout this sequence. They also alternate between 1 and 2 rather than forming a steadily increasing run. The key point is that this is one subject's ordered sequence, not six independent subjects. Treating the six measurements as independent would overstate how much independent information the sequence provides about performance across subjects.
A descriptive lag-one calculation makes the ordering visible. Subtract the mean to obtain deviations \(-0.5,0.5,-0.5,0.5,-0.5,0.5\). Products of adjacent deviations are all \(-0.25\), so adjacent observations alternate around the mean. This particular sequence does not show the familiar positive persistence of same-sign deviations, but its common positive offset still warrants attention. With few time points, a lag pattern is unstable and should be interpreted visually and in context, not treated as a decisive test.
Worked Example: Comparing Residuals Across Doses
In a hypothetical validation, residuals for a biomarker (in \(\mathrm{ng/mL}\)) at a prespecified time are \(1, 0, 2\) at low dose and \(-1, -2, 0\) at high dose. The group means are
The low-dose predictions are below the observations on average, whereas the high-dose predictions are above them on average. The pooled mean is \((1+0+2-1-2+0)/6=0\ \mathrm{ng/mL}\), which conceals this contrast. The pattern suggests dose-dependent prediction performance in this small hypothetical sample; it does not establish why the pattern occurs. Check that groups have comparable observation times and that the dose labels and predictions are aligned correctly before attributing the pattern to dose.
Worked Example: Distinguishing a Shift from Changing Spread
Suppose residuals at two times, in \(\mathrm{pg/mL}\), are \(-1, 0, 1\) at 2 h and \(-4, 0, 4\) at 8 h. Both time-specific means are zero:
The sample standard deviations are \(s_{2\mathrm{h}}=\sqrt{(1+0+1)/(3-1)}=1.00\ \mathrm{pg/mL}\) and \(s_{8\mathrm{h}}=\sqrt{(16+0+16)/(3-1)}=\sqrt{16}=4.00\ \mathrm{pg/mL}\). Thus, the example shows much greater spread at 8 h, not a mean bias at that time. With only three observations per time, these spread estimates are imprecise. In a real validation, inspect subject-level patterns and measurement precision before deciding whether the difference is beyond expected variability.
Why the Patterns Matter: A Short Justification
The diagnostic logic follows from the role of residuals. If predictions are appropriately centered for the prediction target and the observation process, then the expected residual at a given time and dose is zero. Write this conditional statement as \(E(r_{ij}\mid t_{ij},d_i)=0\), where \(t_{ij}\) is time and \(d_i\) is dose. If instead residuals tend to be positive in an early time window, their conditional mean there is positive, which is the definition of local underprediction under the observed-minus-predicted convention.
Likewise, a change in conditional spread, such as a larger \(Var(r_{ij}\mid t_{ij},d_i)\) at later times, indicates that residual variability is not constant across those conditions. This reasoning justifies plotting both residual location and spread. It does not imply that a finite sample will have exactly zero average residual in every subgroup; sampling variation is expected, especially with sparse measurements.
Measurement Noise, Prediction Uncertainty, and Diagnostics
Observed residuals combine several sources of discrepancy. Assay or measurement noise can make observed values depart from a model prediction even when the model captures the relevant systematic time course. Predictions may also be uncertain because of parameter uncertainty or biological variation across subjects. A residual plot alone cannot separate these sources. Its useful role is to show whether deviations look compatible with the stated observation and prediction variability, or whether they form a reproducible pattern that deserves further assessment.
If a defensible predictive standard deviation \(s_{ij,\mathrm{pred}}\) is available, a standardized residual may be formed as \(z_{ij}=r_{ij}/s_{ij,\mathrm{pred}}\). This puts deviations on a scale relative to the expected predictive spread. It is informative only if the denominator represents the relevant uncertainty for that prediction and is not near zero. If it accounts for measurement error alone while ignoring between-subject variation, for example, it can make ordinary subject differences look unexpectedly large. Standardization does not repair a misspecified uncertainty model.
Useful checks include verifying units, time alignment, dose assignment, below-quantification handling, and whether the prediction is for an individual or a population summary. Plot residuals against time and dose, inspect within-subject ordering, and compare the observed spread with the expected measurement and predictive variation. A smooth trend, repeated same-sign runs, or a widening fan is more compelling when it recurs across subjects or is larger than the stated uncertainty would plausibly generate.
Common Pitfalls and Alternatives
- Relying on a pooled mean: an average near zero can result from opposing time or dose patterns. Inspect residuals by relevant condition, not only in aggregate.
- Calling every nonzero residual a model failure: measurement noise and subject-to-subject variability produce nonzero deviations. Consider their expected magnitude and pattern.
- Calling a run of residuals independent evidence: repeated measures from a subject share context and may be correlated. Preserve subject identity and time ordering in plots and summaries.
- Pooling dose groups with different time schedules: an apparent dose trend may instead reflect which times were measured in each group. Compare like times or show the joint time-dose structure.
- Interpreting changing spread as bias: a wider cloud does not, by itself, mean predictions are systematically high or low. Assess the center and spread separately.
- Using an arbitrary standardized residual: dividing by an uncertainty that omits important variability can exaggerate apparent failures. State what the scale includes.
Residual plots complement, rather than replace, other approaches. A summary error measure can compare overall magnitude but may conceal ordering and direction. A time-course plot of observed values and predictions gives direct scale context but can make small systematic offsets hard to see. Residual plots foreground deviations; uncertainty intervals or predictive distributions add information about how surprising those deviations are under an explicit uncertainty model. No single display answers every question, and diagnostic patterns should guide targeted checks rather than substitute for them.
The main limitation is that a residual pattern is not uniquely diagnostic. A trend can arise from prediction error, data processing, timing mismatch, an inappropriate observation scale, or an unrepresented source of variability. Sparse sampling and small numbers of subjects also make apparent patterns unstable. Describe what the plot shows first, then state what it motivates checking; reserve causal or mechanistic explanations for evidence that can support them.
Check Your Understanding
Answer each question using the observed-minus-predicted convention. Brief solutions follow.
- At 6 h, an observed concentration is \(18\ \mathrm{ng/mL}\) and the prediction is \(21\ \mathrm{ng/mL}\). What is the residual, and what does its sign mean?
- Residuals are positive at early visits and negative at late visits, while their pooled mean is near zero. What does the pooled mean conceal?
- Why should six serial observations from one subject not automatically be treated as six independent pieces of evidence?
- At two dose levels, residual means are \(2\ \mathrm{pg/mL}\) and \(-2\ \mathrm{pg/mL}\). What can be concluded, and what should be checked before attributing the contrast to dose?
- Residual means are near zero at early and late times, but the late residuals have much larger spread. Is this evidence of mean bias, changing variability, or both?
Solutions: (1) \(r=18-21=-3\ \mathrm{ng/mL}\), so the prediction exceeds the observation by \(3\ \mathrm{ng/mL}\). (2) The pooled mean conceals time-dependent direction: early underprediction and late overprediction. (3) Measurements from one subject are ordered and may be related, so they do not provide the same independent information as observations from separate subjects. (4) The contrast indicates different average prediction errors in these groups, but does not establish a cause; check comparable time schedules, assignments, and other group differences. (5) It indicates changing residual spread, not necessarily mean bias; assess whether the larger late variability is compatible with measurement and predictive uncertainty.