Why Standardize Conditional Residuals?
A conditional residual compares a subject’s observed marker value with the fitted value for that subject, using the subject-specific effects in the longitudinal model. Standardizing that difference puts it on a scale measured in estimated residual standard deviations. This makes residuals easier to compare across visits and helps identify patterns that a single summary of overall fit could miss.
The qualification “conditional” matters: the fitted value uses an estimate of the subject-specific effects, rather than only the population-average trajectory. As discussed in the earlier material on conditional and marginal residuals in joint models, those two choices answer different diagnostic questions. Here the focus is the within-subject residual for a Gaussian marker and how to scale and inspect it.
Model and Definition
Let \(Y_{ij}\) be the Gaussian marker for subject \(i\) at follow-up time \(t_{ij}\), for visits \(j=1,\ldots,n_i\). A standard longitudinal submodel is
Here \(\mathbf{x}_{ij}\) and \(\mathbf{z}_{ij}\) are known covariate and random-effect design vectors, \(\boldsymbol{\beta}\) is a vector of fixed effects, and \(\mathbf{b}_i\) is the subject-specific random-effect vector. In a joint model, the distribution of \(\mathbf{b}_i\) may also be linked to the event-time submodel. For the basic residual calculation, assume that, conditional on \(\mathbf{b}_i\), the marker errors are Gaussian with mean zero and constant variance \(\sigma^2\), and are independent across visits:
The mean structure must be adequately specified, and the residual variance assumption must be reasonable for the visits being compared. The fitted joint model supplies estimates \(\widehat{\boldsymbol{\beta}}\), \(\widehat{\sigma}\), and a subject-specific estimate \(\widehat{\mathbf{b}}_i\). That estimate may be an empirical Bayes estimate or a posterior mean under the fitted model; the diagnostic should state which information was used to obtain it. For example, a joint-model fit may use both the observed marker history and event-time information.
The denominator is the fitted standard deviation of the marker error, not the standard deviation of the marker values themselves. Thus a marker measured in milligrams has residuals measured in milligrams, while its standardized residuals have no physical units. If the model specifies visit-specific residual variances \(\sigma_{ij}^2\), use the corresponding fitted standard deviation instead:
Why the Residual Standard Deviation Is the Scale
If the true subject effect and model parameters were known, subtracting the conditional mean would leave only the marker error. Under the stated Gaussian model, the conditional residual would therefore have mean zero and variance \(\sigma^2\). Dividing by \(\sigma\) gives a standard normal error. This is the justification for scaling by the residual standard deviation:
In practice, parameters and subject effects are estimated, so \(r_{ij}^{C}\) is not exactly a standard normal variable. In particular, the subject-specific effects are often estimated using the same marker observations whose residuals are then plotted. The resulting in-sample residuals may be pulled toward zero. Treat the standard normal distribution as a useful scale reference, not as an exact finite-sample distribution for every fitted residual.
There is also a distinct uncertainty calculation. If one wants the variance of a replicated marker value conditional on the observed data used to estimate the subject effect, uncertainty in that effect can contribute. For example, if the posterior covariance of \(\mathbf{b}_i\) is \(\mathbf{V}_i\), then a posterior-predictive variance for a replicated marker at the same design point is
That is not the usual residual-only standardization defined above. It answers a different question by including uncertainty about the subject effect. State the convention used rather than silently changing the denominator. Neither denominator removes the fact that an in-sample residual can be affected by using the observation to fit the subject-specific effect.
Worked Example: Scaling Residuals With a Common Error Variance
Suppose a hypothetical subject has marker measurements in milligrams at three visits. The fitted conditional values are \(1.10\), \(1.50\), and \(1.90\) mg, while the observed values are \(1.20\), \(1.55\), and \(1.80\) mg. The fitted residual standard deviation is \(0.20\) mg. Calculate the standardized conditional residual at each visit.
At the first visit, \(e_{i1}^{C}=1.20-1.10=0.10\) mg, so \(r_{i1}^{C}=0.10/0.20=0.500\).
At the second visit, \(e_{i2}^{C}=1.55-1.50=0.05\) mg, so \(r_{i2}^{C}=0.05/0.20=0.250\).
At the third visit, \(e_{i3}^{C}=1.80-1.90=-0.10\) mg, so \(r_{i3}^{C}=-0.10/0.20=-0.500\).
The subject’s observations are therefore \(0.500\), \(0.250\), and \(0.500\) residual standard deviations below or above their fitted conditional values, with the final residual specifically \(-0.500\). The positive values indicate observations above the fit; the negative value indicates an observation below it.
Interpreting Residual Plots
Plot the standardized conditional residuals against the conditional fitted values and against follow-up time. In both plots, zero is the reference line: points above zero are observations higher than fitted, and points below zero are lower. Under a well-fitting mean and variance specification, one hopes to see residuals scattered around zero without a systematic pattern. This is a diagnostic expectation, not a guarantee that every finite sample will look pattern-free.
A plot against fitted values can show whether the discrepancy between observed and fitted markers changes across the range of fitted marker levels. A curve or sustained trend may suggest that the fitted mean structure does not adequately describe the marker trajectory. A plot against time can reveal systematic under- or over-prediction at particular follow-up periods. Clusters of points at similar times, or different ranges of residuals at different times, also deserve attention. These displays are exploratory: a visible pattern identifies a question to investigate, not a unique explanation.
Worked Example: Comparing Visits With Different Fitted Variances
Consider a hypothetical model with a time-dependent residual variance \( \sigma_{ij}^{2}=0.04(1+0.5t_{ij}) \), where time is measured in years and the marker is in mg. At time \(0\), an observation is \(0.30\) mg above its fitted conditional value. At time \(2\) years, another observation is also \(0.30\) mg above its fitted value. Compare their standardized residuals.
At time \(0\), the fitted variance is \(0.04(1+0.5\cdot0)=0.04\) mg\(^2\), so the fitted standard deviation is \(\sqrt{0.04}=0.200\) mg. The standardized residual is \(0.30/0.200=1.50\).
At time \(2\), the fitted variance is \(0.04(1+0.5\cdot2)=0.08\) mg\(^2\), so the fitted standard deviation is \(\sqrt{0.08}=0.2828\) mg. The standardized residual is \(0.30/0.2828=1.061\).
The raw deviations are identical, but their sizes relative to the model’s fitted residual variation differ. Dividing both by \(0.200\) mg would incorrectly treat the variance as constant. This calculation is appropriate only if the time-dependent variance form is part of the specified and fitted model; the plot alone does not establish that form.
Worked Example: Reading a Pattern Against Follow-Up Time
In a hypothetical diagnostic display, standardized conditional residuals from several subjects appear around zero at early visits, but are mostly positive at later visits. For a representative subject, the fitted conditional values at times \(0\), \(1\), \(2\), and \(3\) years are \(2.0\), \(2.2\), \(2.4\), and \(2.6\) mg. The observed values are \(1.9\), \(2.2\), \(2.7\), and \(3.0\) mg, and the fitted residual standard deviation is \(0.20\) mg. Calculate the residuals and describe the diagnostic signal.
The raw residuals are \(1.9-2.0=-0.10\), \(2.2-2.2=0.00\), \(2.7-2.4=0.30\), and \(3.0-2.6=0.40\) mg. Dividing each by \(0.20\) mg gives standardized residuals \(-0.500\), \(0.000\), \(1.50\), and \(2.00\).
The later observations lie above their conditional fitted values, with the last two residuals notably positive on the fitted error scale. If this pattern occurs across subjects, it is a reason to investigate whether the mean trajectory is systematically under-predicting later markers. One subject’s sequence is not enough to establish a general time trend, and the plot does not by itself identify why the pattern occurs.
Assumptions, Comparisons, and Failure Modes
Interpret standardized conditional residuals in light of the assumptions that define them. The Gaussian conditional error model assumes that, given the subject effect, marker deviations have mean zero and the specified variance. The fitted conditional mean must represent the intended marker trajectory, and the fitted variance must be on the correct scale. If the model assumes a common \(\sigma^2\), a standardized residual is not properly calibrated for visits where the true conditional variance differs substantially. If errors are correlated across visits, the individual residuals can remain useful for locating discrepancies, but they are not independent diagnostic observations.
These residuals are also affected by how subject effects are estimated. A subject with a few observations may have a heavily shrunk estimated effect; a subject with many observations may have a more data-driven estimate. In a joint model, event-time information can contribute to the fitted subject effect, depending on the fitting procedure. Accordingly, conditional residual plots assess discrepancies relative to the fitted, subject-specific model; they do not constitute an independent check of the whole model or a formal test with a universal reference distribution.
| Quantity | What it compares | Scale and principal caution |
|---|---|---|
| Raw conditional residual | Observed marker minus subject-specific fitted marker | Marker units; magnitudes are not directly comparable when residual scales differ |
| Standardized conditional residual | Raw conditional residual divided by the fitted conditional residual standard deviation | Dimensionless; in-sample estimation means it is not exactly standard normal |
| Marginal residual | Observed marker minus a fitted value that does not condition on the subject-specific effect | Assesses a different reference fit; see the later material on marginal residuals for longitudinal submodels |
A frequent mistake is to divide by the standard deviation of all observed marker values, or to say that a residual of \(2\) proves the observation is an outlier. The correction is to use the fitted conditional residual standard deviation in the denominator, then interpret the result as a two-standard-deviation discrepancy relative to that model’s scale—not as proof of an outlier or a formal significance result. Likewise, a scatter around zero does not prove that the Gaussian model is correct.
When a plot shows structure, first verify that fitted values, visit times, and the residual standard deviation were matched to the correct subject and observation. Then describe the pattern and consider which part of the model it calls into question. Do not infer a causal explanation from a residual pattern. Conditional residuals are useful for diagnosing within-subject fit, but they do not replace checks of the event-time component, joint association, or predictive performance.
For each observed visit, calculate \(\widehat{Y}_{ij}^{\,C}\) using the fitted fixed effects and the stated subject-specific effect estimate.
Subtract the fitted value from the observed marker, then divide by the fitted residual standard deviation appropriate to that visit.
Plot against conditional fitted values and follow-up time; report patterns as signals to investigate, not definitive diagnoses.
Check Your Understanding
Answer each question, then check the solutions below.
- An observed marker is \(4.8\) units and its conditional fitted value is \(5.1\) units. If the fitted residual standard deviation is \(0.15\) units, what is the standardized conditional residual?
- Why should a raw residual of \(0.4\) units not automatically be judged equally large at two visits with different fitted residual standard deviations?
- What might a persistent positive pattern at late follow-up suggest, and what can it not establish on its own?
- Why are in-sample standardized conditional residuals not necessarily independent draws from \(N(0,1)\)?
Solutions. For question 1, \(e^C=4.8-5.1=-0.3\) units and \(r^C=-0.3/0.15=-2.00\). The observation is two fitted residual standard deviations below its conditional fit. For question 2, the standardized values are the raw residuals divided by their visit-specific fitted standard deviations, so the same raw difference can represent different discrepancies on the model’s scale. For question 3, a persistent late positive pattern may signal that the fitted mean is under-predicting later marker values; it does not identify the cause or prove that the mean model is misspecified. For question 4, the model parameters and subject effects are estimated, often using the same observations being assessed, and within-subject errors may also be dependent if the model allows dependence. Thus the ideal standard normal result for known parameters and true subject effects does not apply exactly to fitted residuals.