Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Common Misreadings Of Joint-Model Residuals

Model Diagnostics · Tutorial 621 of 697

Common Misreadings Of Joint-Model Residuals

You will learn to interpret common joint-model residuals without mistaking conditional, shrunken, censored, or isolated quantities for independent evidence of model failure.

Advanced 11 min read

What You'll Learn

  • Distinguish conditional longitudinal residuals from marginal prediction errors.
  • Explain why empirical Bayes random effects are shrunken and not direct observations of latent effects.
  • Interpret martingale residuals when event times are censored.
  • Recognize how repeated measurements and parameter estimation affect residual reference distributions.
  • Evaluate an isolated extreme residual using its sampling context and multiplicity.
  • Choose diagnostics that match the question and the model structure.

Why the Sampling Structure Matters

A residual is a discrepancy between observed data and a model-based expectation. It is useful only when interpreted against the process that produced it. In a joint model, observations from one person share latent random effects, event times may be censored, and fitted parameters are estimated from the same subjects being checked. Consequently, a residual is not automatically an independent draw from a standard reference distribution. A large value can signal model misfit, but it can also reflect conditioning, shrinkage, censoring, or the chance of seeing an extreme among many checks.

For a simple shared-parameter joint model, write the longitudinal outcome for person \(i\) at visit \(j\) as \(Y_{ij}\), with conditional mean \(m_i(t_{ij};b_i)\) and residual error \(\epsilon_{ij}\). Here \(b_i\) is a person-specific random effect. A possible event hazard conditional on the same random effect is \(h_i(t\mid b_i)\). The precise model may be more elaborate, but these components suffice to clarify common misreadings. The earlier material on residual diagnostics and posterior predictive checks establishes tools for examining model fit; the focus here is how not to overinterpret individual residual quantities.

Definition: A conditional longitudinal residual compares an observed measurement with its model-based mean conditional on a specified or estimated subject-specific random effect. An empirical Bayes random effect is a subject-specific estimate, commonly a posterior mean or mode, obtained by combining that subject's data with the assumed population distribution of random effects. A martingale residual for an event process is the observed event count minus its fitted cumulative hazard while the person was at risk.

These definitions already signal three distinct sources of caution. A conditional residual depends on what is held fixed; an empirical Bayes estimate is a shrunken estimate rather than an observed latent quantity; and a censored event contributes information about survival up to censoring, not a known event time. Isolated extremes add a fourth issue: many residuals are examined, often with dependence among them.

Conditional Residuals Are Not Marginal Prediction Errors

Suppose the longitudinal model is \(Y_{ij}=m_i(t_{ij};b_i)+\epsilon_{ij}\), with \(\epsilon_{ij}\) having mean zero and variance \(\sigma^2\) conditional on \(b_i\). A raw conditional residual is \(e_{ij}=Y_{ij}-m_i(t_{ij};\widehat b_i)\), where \(\widehat b_i\) is an estimated random effect. It asks whether a measurement differs from the fitted trajectory for that particular person. It does not ask whether the measurement differs from the population-average trajectory.

If the conditional error is normal with known parameters and the true \(b_i\) is fixed, then \([Y_{ij}-m_i(t_{ij};b_i)]/\sigma=\epsilon_{ij}/\sigma\) has a standard normal distribution under the model. In practice, however, \(b_i\) and model parameters are estimated, often using the same measurements whose residuals are being inspected. A residual based on \(\widehat b_i\) therefore does not generally have that simple reference distribution. The fitted subject trajectory can absorb some of the person's unusual pattern, making its conditional residuals look less extreme than marginal prediction errors would.

Worked Example: A Small Conditional Residual After Fitting a Subject Trajectory

Hypothetical data. A biomarker is measured three times for one person. A fitted joint model gives conditional mean predictions of 10, 12, and 14 units after using the person's empirical Bayes random effect. The observed values are 11, 11, and 16 units. Suppose the estimated conditional residual standard deviation is 2 units.

The raw conditional residuals are observed minus predicted: \(11-10=1\), \(11-12=-1\), and \(16-14=2\) units. Standardizing by 2 units gives \(0.5\), \(-0.5\), and \(1.0\).

$$ r_{ij}^{\mathrm{cond}}=\frac{Y_{ij}-m_i(t_{ij};\widehat b_i)}{\widehat\sigma}, \qquad (1/2,\,-1/2,\,2/2)=(0.5,\,-0.5,\,1.0). $$

None is individually beyond two estimated residual standard deviations. That is a modest discrepancy from this person's fitted trajectory, not proof that the population trajectory or joint model is correct. The predictions used \(\widehat b_i\), which was informed by the person's data, and the three residuals belong to the same person. They should not be read as three independent tests against a fixed population mean.

The distinction is especially important when a diagnostic compares conditional residuals with marginal predictions. Marginal predictions average over the random-effects distribution; conditional predictions use a subject-specific effect. They answer different questions and have different predictive variability. A residual that is ordinary conditionally may be unusual relative to the population distribution, or vice versa. State which prediction is being assessed before interpreting the residual.

Empirical Bayes Random Effects Are Shrunken

Empirical Bayes estimates are often plotted or inspected as if they were observed values of \(b_i\). They are not. The data for a person may be sparse or noisy, so the estimate is pulled toward the population mean (usually zero for a centered random effect). The amount of shrinkage varies with the information available for that person and the estimated random-effects distribution.

A simple normal calculation shows the mechanism. Suppose \(b\sim N(0,1)\), and a subject-specific summary \(Z\) satisfies \(Z\mid b\sim N(b,0.25)\), independently of other subjects conditional on \(b\). Completing the square in the normal posterior density gives a posterior variance \(1/(1+4)=0.2\) and posterior mean \(0.8Z\). Thus the estimate is only 80% of the observed summary in this example.

Worked Example: Shrinkage Can Hide a Large Subject-Specific Summary

Hypothetical data. In the normal model just described, suppose one person's summary is \(Z=2.5\) standard units. The posterior mean, used here as the empirical Bayes estimate, is \(0.8(2.5)=2.0\). The posterior standard deviation is \(\sqrt{0.2}\approx0.447\).

$$ E(b\mid Z)=\frac{1}{1+0.25}Z=0.8Z=2.0, \qquad \operatorname{Var}(b\mid Z)=\frac{1}{1+4}=0.2. $$

The estimate is less extreme than the summary because it incorporates the population distribution. It is not correct to conclude that the person's true effect is exactly 2.0, or that an empirical distribution of these estimates should reproduce the full population spread of the \(b_i\)'s. In real joint models, uncertainty in estimated population parameters adds another layer of uncertainty.

A narrow spread of empirical Bayes effects can therefore be expected even when the random-effects distribution is correctly specified. Conversely, a few large estimates do not, by themselves, establish a heavy-tailed population distribution: their magnitude must be considered alongside the amount of subject-specific information and uncertainty. For distributional diagnostics, use procedures that account for estimation and shrinkage, such as the simulation-based checks developed for random-effects distributions, rather than treating estimates as raw independent draws.

Censoring Changes What an Event Residual Says

Let \(T_i\) be the observed follow-up time, the minimum of the event time and censoring time, and let \(\delta_i=1\) when the event is observed and \(0\) when follow-up ends by censoring. Given a subject's random effect and covariates, define the fitted cumulative hazard through time \(t\) as \(H_i(t)=\int_0^t h_i(u\mid b_i)\,du\). The basic martingale residual is \(M_i=\delta_i-H_i(T_i)\), with fitted quantities substituted in practice.

For an observed event, the event count is one, so the residual is \(1-H_i(T_i)\). For a censored person, the observed event count is zero, so it is \(-H_i(T_i)\). A negative residual for a censored person does not mean that a future event was observed earlier than it should have been. It reflects survival without an event through the observed follow-up, compared with the model's cumulative hazard over that period. Censoring time is not the unobserved event time.

Worked Example: The Same Follow-Up Time, Different Event Status

Hypothetical data. Two people each have four time units of follow-up. The fitted cumulative hazard to time 4 is \(H_i(4)=0.80\) for both. Person A has an observed event at time 4; person B is censored at time 4.

For person A, \(\delta_A=1\), so \(M_A=1-0.80=0.20\). For person B, \(\delta_B=0\), so \(M_B=0-0.80=-0.80\). The arithmetic uses the same cumulative hazard, but the event indicator changes the residual.

The difference does not show that person B's unobserved event occurred at time 4. It shows only that B remained event-free for the observed four time units. Neither value is a standardized normal score, and neither should be compared with a normal cutoff without a justified reference distribution. In a joint model, these fitted cumulative hazards may also depend on estimated random effects and shared parameters.

The martingale-residual construction is motivated by the counting-process difference between observed events and their fitted cumulative intensity while at risk. Under a correctly specified intensity and appropriate independent censoring, that process has mean-zero increments in the relevant filtration. This property does not make a single fitted residual normally distributed: event counts are discrete, follow-up varies, and parameters and random effects are estimated. Censoring assumptions matter as well. If censoring is informative given the variables and random effects included in the model, the event-process diagnostic may be misleading because the observed risk process no longer reflects the assumed observation mechanism.

An Isolated Extreme Is Not a Verdict

Even if individual residuals had a standard normal reference distribution, examining many residuals makes at least one apparently large value unsurprising. Under the idealized assumption of \(n\) independent standard normal residuals, the probability that at least one has absolute value above 2 is \(1-(1-0.0455)^n\), since 0.0455 is approximately the two-sided standard normal tail probability beyond 2. With \(n=10\), this is about 37.2%. This calculation is an illustration, not a universal joint-model calibration: repeated measurements within a person are dependent, and fitted residuals are not generally independent standard normals.

Worked Example: Interpreting One Large Value Among Many Checks

Hypothetical diagnostic screen. Suppose a researcher inspects 10 independent standard normal quantities, solely to illustrate multiplicity, and flags any absolute value above 2. The probability that none is flagged is \(0.9545^{10}\approx0.6277\). Therefore the probability of at least one flag is \(1-0.9545^{10}\approx1-0.6277=0.3723\), or about 37.2%.

Thus, even under this ideal reference setup, a single value beyond 2 is not surprising when 10 values are screened. In a joint-model analysis, the independence and reference-distribution assumptions used for this arithmetic may fail. Repeated observations, shared random effects, and parameter fitting alter the joint distribution of residuals. The correct response is not to ignore the extreme, but to examine its measurement time, subject, event status, leverage, and compatibility with broader patterns, then use a calibrated diagnostic such as a simulation envelope when appropriate.

Practical Reading and Failure Modes

A diagnostic is most informative when its target and sampling unit are explicit. Ask whether the check concerns within-person measurement errors, subject-level heterogeneity, the event process, or joint dependence. Also ask whether it is conditional on estimated random effects, and whether the reference distribution accounts for fitting and censoring. The earlier material on simulation envelopes and bootstrap uncertainty provides tools for calibration; here the central point is that calibration must correspond to the quantity being plotted.

Quantity inspectedCommon misreadingMore defensible interpretation
Conditional longitudinal residualEach value is an independent standard normal testA within-person discrepancy conditional on an estimated trajectory; dependence and fitting affect its reference distribution
Empirical Bayes random effectThe estimated value is the person's true latent effectA shrunken estimate with uncertainty that varies by subject
Martingale residual at censoringThe censored time is the event timeSurvival information up to the censoring time, represented by zero observed events and accumulated fitted hazard
One extreme among many residualsOne cutoff proves model failureA signal to investigate in context, allowing for multiplicity and dependence

Common failure modes include standardizing a conditional residual by \(\widehat\sigma\) and assuming that this alone gives a standard normal score; comparing the spread of empirical Bayes effects directly with the latent random-effects spread; assigning a censored person an event residual as if the event had occurred at censoring; and declaring a model invalid because one of many inspected values crosses a familiar cutoff. The corrections are to identify the conditioning, recognize shrinkage, preserve the distinction between event and censoring, and evaluate patterns using an appropriate reference distribution.

These cautions do not make residuals unhelpful. A cluster of large residuals at late visits can suggest time-dependent longitudinal misfit; systematic event residual patterns can point toward hazard misfit; and a subject with an extreme biomarker pattern and an unusual event history may motivate a joint check. Such signals are stronger when they recur in a meaningful structure or persist under a calibrated comparison than when they consist of one uncontextualized value.

Key takeaway: A joint-model residual is a model-dependent diagnostic quantity, not automatically a direct observation of error, latent effect, or event time. Interpret it by stating what was conditioned on, what was observed or censored, and how the quantity's reference distribution was obtained.

Check Your Understanding

Answer each question, then compare with the concise solutions below.

  1. Why can conditional residuals from one person's repeated measurements not automatically be treated as independent tests against a population trajectory?
  2. In the normal shrinkage example, what is the empirical Bayes estimate when \(Z=1.5\), and why is it not the person's known true effect?
  3. A subject is censored at time \(t\) with fitted cumulative hazard \(H_i(t)=0.6\). What is the basic martingale residual, and what does it represent?
  4. Under the idealized independent standard normal calculation, what is the probability of at least one absolute residual exceeding 2 among 10 checks?
  5. Name two features that should be examined before treating one extreme residual as evidence of model failure.

Solutions. (1) They share an estimated subject trajectory and random effect, and the same data may have been used to estimate those quantities; their distribution is therefore not automatically independent or standard normal. (2) The estimate is \(0.8(1.5)=1.2\). It combines the observed summary with the assumed population distribution, so it is a shrunken estimate with uncertainty. (3) Since \(\delta_i=0\), \(M_i=0-0.6=-0.6\); it records no event observed while accumulating fitted hazard through the censoring time, not an event at that time. (4) \(1-0.9545^{10}\approx1-0.6277=0.3723\), or about 37.2%, under the stated idealized assumptions. (5) Examples include the person's other measurements, visit time, event or censoring status, leverage, dependence with other residuals, and whether the value belongs to a broader systematic pattern.

Clinical Biostats