Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Residual Evidence About The Association Link

Model Diagnostics · Tutorial 611 of 697

Residual Evidence About The Association Link

Use residual patterns across biomarker values, slopes, and event times to assess whether the fitted longitudinal-to-hazard association is plausible.

Advanced 12 min read

What You'll Learn

  • Define residual evidence for a joint model’s longitudinal-to-hazard association structure
  • Read event-residual patterns across predicted biomarker levels and slopes
  • Use event-time strata to assess whether a pattern is persistent or timing-dependent
  • Derive a residual-based score for a candidate association feature
  • Separate association-link concerns from baseline-hazard misfit and longitudinal residual problems
  • Recognize the limits of residual plots and avoid treating them as automatic model-selection tests

Why Examine the Association Through Residuals?

A joint model connects a subject’s longitudinal biomarker trajectory to the hazard of an event. Even if the fitted trajectory describes the measurements reasonably well, the way that trajectory enters the hazard may still be inadequate. For example, a model might use the current biomarker value when the hazard is more closely associated with its rate of change, or impose a linear effect where the residual evidence suggests curvature.

The aim here is not to select an association structure from one plot. It is to ask whether event residuals show systematic patterns when subjects or risk intervals are organized by fitted biomarker level, fitted slope, and event timing. Residual evidence is most useful when it is read alongside longitudinal diagnostics and checks of the event-time distribution.

Model and Residual Definitions

Let \(y_{ij}\) be the biomarker measurement for subject \(i\) at time \(t_{ij}\), and let \(m_i(t;b_i)\) be the fitted latent biomarker trajectory conditional on subject-specific random effects \(b_i\). Write \(Y_i(t)=1\) while subject \(i\) is at risk and \(Y_i(t)=0\) after the event or censoring. Let \(N_i(t)\) count the event, so that \(\delta_i=N_i(\tilde T_i)\), where \(\tilde T_i=\min(T_i,C_i)\) is the observed follow-up time.

A general association model has hazard

$$ h_i(t\mid b_i)=h_0(t)\exp\left\{\gamma^\mathsf{T}w_i+\alpha g\big(m_i(t;b_i),m_i'(t;b_i),b_i\big)\right\}. $$

Here \(h_0(t)\) is the baseline hazard, \(w_i\) contains other covariates, and \(g\) specifies the association structure. Examples include current value \(g=m_i(t;b_i)\), current slope \(g=m_i'(t;b_i)\), or a specified combination of the two. The model assumes that, conditional on the included covariates and latent effects, the event hazard is represented by this expression; the longitudinal trajectory and event model must also be specified adequately for the joint likelihood to be meaningful.

Definition: An association-link residual diagnostic examines whether event-model residuals vary systematically with fitted features of the longitudinal trajectory, such as \(m_i(t;b_i)\) or \(m_i'(t;b_i)\). A pattern indicates possible inadequacy in the fitted association structure, but does not by itself identify the correct replacement model.

For the longitudinal component, a basic residual is \(e_{ij}=y_{ij}-\hat m_i(t_{ij})\), with any standardization chosen to match the measurement model. These residuals help assess whether the trajectory used to construct the hazard is credible; systematic trajectory error can masquerade as a problem in the association link. For the event component, the counting-process martingale residual under a specified hazard is

$$ M_i(t)=N_i(t)-\int_0^t Y_i(u)h_i(u\mid b_i)\,du. $$

At the end of observed follow-up, this becomes \(\delta_i-\int_0^{\tilde T_i}h_i(u\mid b_i)\,du\). Under the correctly specified hazard and known latent effects, the martingale has mean-zero increments conditional on the observed risk history. In practice, model parameters are estimated and \(b_i\) is latent, so plug-in residuals are approximate diagnostics, not exact independent errors.

How to Read Patterns Across Trajectory Features

A useful diagnostic asks whether event residuals have a systematic direction across ordered groups of fitted biomarker level or slope. For example, if subjects with high fitted values repeatedly have positive event residuals, the fitted model has observed more events than its hazard predicted in that region. This is evidence that the fitted hazard may be too low there. Predominantly negative residuals indicate the reverse: fewer events occurred than predicted.

For a time-varying trajectory feature \(q_i(t)\), a residual contrast can be written as

$$ U(q)=\sum_i\int_0^\tau q_i(t)\,dM_i(t) =\sum_i\int_0^\tau q_i(t)\left\{dN_i(t)-Y_i(t)h_i(t\mid b_i)\,dt\right\}. $$

The feature \(q_i(t)\) should be defined from information available just before time \(t\), so it is predictable. A positive \(U(q)\) means event residual increments tend, in aggregate, to be positive when \(q_i(t)\) is positive; it gives a direction for investigation, not an automatic significance test. When fitting the model, parameter estimation and latent-effect uncertainty affect the reference distribution. A formal test therefore needs an appropriate variance calculation or resampling procedure, rather than treating \(U(q)\) as a standard normal statistic by default.

A Residual-Score Justification

The connection between this diagnostic and association-link adequacy can be seen by adding a candidate feature \(q_i(t)\) to the linear predictor. Suppose the perturbed hazard is \(h_{i,\beta}(t)=h_i(t)\exp\{\beta q_i(t)\}\), with the original fitted model corresponding to \(\beta=0\). Conditional on the latent effects, the event log likelihood contribution involving this hazard is

$$ \ell(\beta)=\sum_i\int_0^\tau \log h_{i,\beta}(t)\,dN_i(t) -\sum_i\int_0^\tau Y_i(t)h_{i,\beta}(t)\,dt. $$

Since \(\partial\log h_{i,\beta}(t)/\partial\beta=q_i(t)\) and \(\partial h_{i,\beta}(t)/\partial\beta=q_i(t)h_{i,\beta}(t)\), differentiating and evaluating at zero gives

$$ \left.\frac{\partial\ell(\beta)}{\partial\beta}\right|_{\beta=0} =\sum_i\int_0^\tau q_i(t)\left\{dN_i(t)-Y_i(t)h_i(t)\,dt\right\} =U(q). $$

Thus, the residual contrast is the likelihood score for adding that feature when the current model is treated as fixed. If a slope-based \(q_i(t)\) has a coherent score pattern, for instance, it motivates examining a slope association. This derivation does not establish that the feature should be added: the fitted model’s parameters may need to be re-estimated, and the observed score can also reflect baseline-hazard error, trajectory misspecification, or chance variation.

Worked Example: Residuals Increasing With Biomarker Level

Suppose a hypothetical fitted joint model uses a linear current-value association. For illustration, subjects’ observed event counts and model-expected event counts are summarized in three groups formed by their fitted current biomarker level. The expected counts account for each group’s observed time at risk.

Fitted biomarker groupObserved eventsExpected eventsObserved minus expected
Low33.2-0.2
Middle55.1-0.1
High84.04.0

The grouped residual contrast is observed minus expected. In the high group it is \(8-4.0=4.0\) events; in the low and middle groups it is \(3-3.2=-0.2\) and \(5-5.1=-0.1\). Across all groups, the contrast is \(16-12.3=3.7\) events, but the key diagnostic feature is not the overall total: it is the concentration of positive residuals in the high-value group.

If the same pattern appears across reasonable groupings and is not explained by poor trajectory fit or event-time calibration, it suggests that the fitted hazard underpredicts events at high biomarker levels. Curvature in the current-value association is one possibility. The residual pattern alone does not prove curvature or establish a causal effect; it identifies a region where the fitted association deserves scrutiny.

Worked Example: A Candidate Slope Feature

Consider a hypothetical residual summary for four subjects. Let \(z_i\) be each subject’s centered fitted slope feature, with positive values indicating steeper increases, and let \(M_i\) be the subject-level event residual. For this small illustration, use the contrast \(U=\sum_i z_iM_i\).

SubjectCentered fitted slope \(z_i\)Event residual \(M_i\)Product \(z_iM_i\)
1-1-0.40.4
20-0.20
310.10.1
420.51.0

Adding the products gives \(U=0.4+0+0.1+1.0=1.5\). The positive contrast says that higher fitted slopes tend to coincide with more positive event residuals in this summary. It motivates checking whether a slope term captures a systematic pattern left by the current fitted association.

The value \(1.5\) is not a p-value and should not be compared with a generic cutoff. The subjects’ follow-up times and risk contributions differ, and the residuals depend on fitted parameters and latent effects. A principled inferential assessment would account for those features. This example demonstrates direction of evidence, not a formal test.

Worked Example: Reading Residuals Across Event Timing

In a hypothetical analysis, residual counts are examined separately in early and late follow-up and within low- and high-biomarker strata. The expected counts are calculated using each interval’s risk time.

Follow-up periodBiomarker groupObserved eventsExpected eventsResidual count
EarlyLow22.2-0.2
EarlyHigh63.03.0
LateLow33.1-0.1
LateHigh44.2-0.2

For early follow-up, the high-biomarker residual count is \(6-3.0=3.0\), while the low-biomarker count is \(2-2.2=-0.2\). For late follow-up, the corresponding values are \(4-4.2=-0.2\) and \(3-3.1=-0.1\). The high-biomarker discrepancy is therefore concentrated in early follow-up in this table; it is not a uniform high-versus-low pattern throughout follow-up.

This timing dependence cautions against concluding that a single, time-constant biomarker association is wrong. The pattern could reflect event-time calibration, an association inadequacy that is not constant over follow-up, sparse events, or other model problems. The appropriate conclusion is that the fitted event predictions should be checked jointly across biomarker strata and time, not that this table identifies a unique correction.

Diagnostics, Alternatives, and Limitations

A practical assessment uses several views of the same fitted model. First inspect longitudinal residuals and trajectory checks: if the fitted biomarker level or slope is systematically wrong, sorting event residuals by those fitted quantities can be misleading. Then examine event residuals against fitted current values and slopes, preferably with risk-set-aware summaries or smooth displays rather than relying only on arbitrary cut points. Finally, compare patterns across event-time ranges. A discrepancy that appears for all biomarker levels at similar times points more directly toward event-time calibration than toward the biomarker association.

The distinction is not always clean. A misspecified baseline hazard can create event residual patterns that vary with biomarker level if the groups have different follow-up distributions. Censoring and changing risk sets also affect the information available at different times. Therefore compare observed and expected event contributions using the actual risk time, not raw event counts alone. When random effects are latent, plug-in fitted trajectories and hazards may understate uncertainty; posterior predictive checks can provide a complementary assessment by comparing observed summaries with summaries from replicated data generated under the fitted joint model.

Residual plots are descriptive, while likelihood-based comparisons of alternative association structures answer a different question and require refitting. A formal score or likelihood-ratio analysis can quantify evidence under its stated assumptions; residual displays can reveal where the discrepancy lies and whether it is clinically interpretable. Neither approach makes an association causal without suitable design and assumptions. The evidence may also be weak when events are few, measurement times are sparse, or fitted slopes are noisy.

Common pitfall: “The high-biomarker group has positive event residuals, so the biomarker must have a stronger causal effect than the model says.” This reasoning overstates what the diagnostic shows. Positive residuals mean that observed events exceeded the fitted model’s expectation in that region. The pattern may arise from the association link, baseline-hazard misfit, trajectory error, risk-set differences, or random variation. Treat it as a model-checking signal, not a causal conclusion or a model-selection rule.

Residual evidence is strongest when the same qualitative pattern is stable under reasonable plotting choices, is supported by adequate risk time, and remains after checking trajectory fit and overall event-time calibration. It is weakest when driven by a few events, a single grouping boundary, or a handful of subjects. The diagnostic’s role is to make a potential association inadequacy visible and guide a more careful model comparison.

Check Your Understanding

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

  1. A high fitted biomarker group has 10 observed events and 7 expected events. What is its event-residual contrast, and what does its sign mean?
  2. Why does a positive score contrast for a candidate slope feature not, by itself, establish that the slope belongs in the model?
  3. All biomarker groups show positive event residuals during early follow-up and near-zero residuals later. Is this pattern specific evidence of an incorrect biomarker association?
  4. Name one way longitudinal trajectory misspecification can distort a residual diagnostic of the association link.

Solutions. (1) The contrast is \(10-7=3\) events. It is positive, so observed events exceeded the model-expected count in that group; it does not alone identify why. (2) The contrast gives a direction of score evidence, but fitted-parameter uncertainty, latent effects, risk contributions, and other model errors must be considered; formal inference requires an appropriate reference distribution or model comparison. (3) No. A pattern shared across biomarker groups and concentrated in time is consistent with event-time calibration problems, among other explanations, so it is not specific to the association link. (4) If the fitted trajectory systematically underestimates levels or slopes, subjects may be assigned to inappropriate fitted-feature values, creating an apparent association residual pattern even when the event link itself is not the source.

Clinical Biostats