Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Cross-Marker Residual Checks In Joint Models

Multiple Longitudinal Markers · Tutorial 392 of 697

Cross-Marker Residual Checks In Joint Models

You will learn to construct and interpret residual checks for multiple longitudinal markers while accounting for random-effects estimation, repeated measurements, and the model’s assumed residual covariance.

Advanced 12 min read

What You'll Learn

  • Define conditional and standardized residuals for each longitudinal marker
  • Check whether residual means vary over time or other predictors
  • Compare residual variability with the model’s variance assumptions
  • Assess cross-marker residual correlations at comparable measurement times
  • Recognize how empirical random effects and repeated observations affect residual checks
  • Use plots and simulation-based checks to investigate model misfit

Why Check Residuals Across Markers?

A joint model can include several longitudinal markers and still leave important patterns unexplained. For example, residuals for one marker may drift upward with time, their spread may increase, or two markers may remain correlated after accounting for the model’s shared random effects. Such patterns suggest that the longitudinal submodel may not represent the observed data adequately. They matter because the longitudinal model contributes to the estimated latent trajectories and, through those trajectories or random effects, to the survival component.

Cross-marker residual checks are diagnostics, not a test that proves a model correct. A visible pattern can indicate a useful direction for model revision, while a lack of visible pattern does not establish that every assumption holds. The checks should be interpreted in light of the fitted model’s mean and covariance structure, the timing of measurements, and the fact that observations from the same person are not independent.

Model and Residual Definitions

Let \(Y_{ikj}\) be the observed value of marker \(k\) for subject \(i\) at measurement time \(t_{ikj}\), where \(k=1,\ldots,K\). A common multivariate longitudinal specification can be written in stacked form as

$$ Y_i = X_i\beta + Z_i b_i + \varepsilon_i,\qquad b_i\sim N(0,D),\qquad \varepsilon_i\mid b_i\sim N(0,R_i). $$

Here \(X_i\beta\) is the fixed-effects mean, \(b_i\) is the vector of subject-specific random effects, \(Z_i b_i\) gives their contribution at the observed measurement times, and \(R_i\) is the residual covariance matrix. This formulation allows the model to specify, for example, marker-specific residual variances or residual correlations. In a joint model, the event-time component is also modeled, often conditional on the same random effects or on the latent marker trajectories. The residual checks here concern the longitudinal component; they do not by themselves diagnose every part of the survival model.

Definition: A conditional residual for an observed marker value is the observation minus its fitted mean conditional on the subject’s random effects: \(r_{ikj}=Y_{ikj}-\widehat{E}(Y_{ikj}\mid b_i)\). A standardized conditional residual divides this difference by its model-implied residual standard deviation. If that standard deviation is \(\sigma_{ikj}\), then \(e_{ikj}=r_{ikj}/\sigma_{ikj}\). Residuals may use estimated rather than known parameters and random effects, so they are diagnostic quantities, not independent observations with exactly known distributions.

A residual is conditional on the subject-specific component, whereas a marginal residual compares an observation with a mean that averages over the random-effects distribution. These answer different questions. Conditional residuals are useful for checking what remains after accounting for subject-specific trajectories. Marginal residuals also include variation among subjects and should not be judged against a conditional residual variance. In practice, estimated random effects are often empirical Bayes estimates informed by the observed markers and, in a joint model, potentially by the event information as well.

Before interpreting a residual pattern, state the model’s assumptions. For the Gaussian formulation above, these commonly include a correctly specified conditional mean, a specified covariance \(R_i\), and an appropriate distribution for the random effects. Conditional errors may be assumed independent across markers, or their covariance may be explicitly modeled; they may be assumed to have constant variance, or variance may be allowed to depend on marker or time. A diagnostic must be compared with the assumption actually made. In particular, zero cross-marker residual correlation is expected only when the fitted model implies zero correlation for the relevant residual pairs.

What Patterns to Inspect

For each marker, plot residuals against measurement time, fitted value, and important predictors in the mean model. A residual mean that changes systematically with time may indicate an inadequate time trend, a missing nonlinear component, or another omitted mean feature. A changing vertical spread can indicate unequal variability. Residuals should also be examined by marker: a pooled plot can hide a problem affecting just one marker or confuse markers measured on different scales.

For cross-marker checks, compare residuals from the same subject at comparable times, or use a clearly defined time-adjusted or model-based comparison when measurements are not simultaneous. If the model assumes conditionally independent errors across markers, residual pairs should not show persistent association after accounting for the fitted trajectories and other modeled structure. If \(R_i\) includes cross-marker covariance, the question is instead whether the observed residual association is compatible with that covariance specification. A raw pooled correlation across every recorded measurement can be misleading: subjects contribute different numbers of observations, times may differ, and repeated measurements within a subject are dependent.

Worked Residual Checks

Worked Example: A Cross-Marker Residual Correlation

Suppose a hypothetical fitted model assumes independent conditional errors across two markers. For four hypothetical subjects, the standardized conditional residuals from comparable measurement times are \((-2,-1,1,2)\) for marker A and \((-1,0,0,1)\) for marker B. Calculate the paired sample correlation as a descriptive check.

Both residual series have mean zero. The sum of cross-products is \( (-2)(-1)+(-1)(0)+(1)(0)+(2)(1)=4\). The sums of squares are \(10\) for marker A and \(2\) for marker B. Therefore,

$$ r_{AB} = \frac{\sum_{\ell=1}^{4}(e_{A\ell}-\bar e_A)(e_{B\ell}-\bar e_B)} {\sqrt{\sum_{\ell=1}^{4}(e_{A\ell}-\bar e_A)^2 \sum_{\ell=1}^{4}(e_{B\ell}-\bar e_B)^2}} = \frac{4}{\sqrt{10(2)}}=0.8944. $$

This is a strong positive association in these four pairs, which is worth investigating if zero conditional cross-marker correlation was assumed. It is not convincing evidence on its own: four pairs provide little information, and if the pairs came from repeated measurements on fewer subjects, the effective information would be smaller still. A broader check should account for subjects and compare the observed pattern with what the fitted model implies.

Worked Example: Checking Unequal Residual Variability

In a hypothetical marker analysis, standardized conditional residuals from three early measurements are \((-1,0,1)\), while those from three late measurements are \((-2,0,2)\). If the fitted model implies unit residual variance at both time periods, compare the sample spreads.

Each group has mean zero. Using the sample variance with denominator \(n-1=2\), the early variance is \(s^2_{\text{early}}=[(-1)^2+0^2+1^2]/2=1\), so the early sample standard deviation is \(1\). The late variance is \(s^2_{\text{late}}=[(-2)^2+0^2+2^2]/2=4\), so the late sample standard deviation is \(2\).

The late residuals have four times the sample variance of the early residuals, despite a model that implies unit variance in both periods. This small hypothetical example suggests possible time-varying variability, but it does not establish it: with only three residuals per period, individual values have substantial influence. In a real diagnostic, inspect the residual-versus-time plot and assess the spread across subjects, preferably against model-based reference patterns.

Worked Example: Detecting a Residual Time Trend

Suppose four hypothetical time groups have mean standardized residuals \(-0.6,-0.2,0.2,0.6\) at times \(0,1,2,3\) years. Fit a simple descriptive straight line to these group means. The mean time is \(1.5\) years and the mean residual is \(0\). The slope is

$$ \widehat{\beta}_{\text{res,time}} = \frac{\sum_{g=1}^{4}(t_g-\bar t)(\bar e_g-\bar e)} {\sum_{g=1}^{4}(t_g-\bar t)^2} = \frac{0.9+0.1+0.1+0.9}{2.25+0.25+0.25+2.25} = \frac{2}{5}=0.4. $$

The fitted descriptive trend is an increase of \(0.4\) standardized residual units per year. Under a correctly specified conditional mean, a systematic residual trend is not expected. This pattern therefore motivates checking the time specification, such as whether the assumed mean trajectory is too simple. The slope is a summary of four group means, not a formal test: it ignores within-group variation and subject-level dependence.

Why Plug-In Residuals Need Careful Interpretation

Even when the model is correct, residuals computed using estimated random effects are not the same as the unobserved errors. To see the distinction, first suppose the fixed parameters are known and write the residual using an estimated random effect \(\widehat b_i\):

$$ Y_i-X_i\beta-Z_i\widehat b_i = \varepsilon_i+Z_i(b_i-\widehat b_i). $$

The first term is the conditional error. The second is the discrepancy between the true and estimated random effects, carried through the design matrix. Thus the fitted residuals can retain dependence induced by random-effect estimation even when the model’s conditional errors are independent across markers. Also, the same observations help estimate \(\widehat b_i\), which can make fitted residuals smaller than genuinely new errors.

This explains why a nonzero empirical cross-marker residual correlation is a signal to investigate, not automatic proof that the conditional error covariance is misspecified. The fitted mean, random-effects structure, timing alignment, and residual covariance all affect the pattern. When a diagnostic conclusion matters, compare the observed checks with replicated data generated under the fitted model, using the same measurement schedule and refitting the model in each replicate. This simulation-based comparison accounts more naturally for parameter estimation and shrinkage than a reference distribution that treats fitted residuals as independent.

Practical Workflow, Alternatives, and Limitations

1
Write down the implied residual structure.
For each marker and time, identify the fitted mean and variance. State whether the model allows within-marker serial correlation or cross-marker residual covariance.
2
Inspect marker-specific patterns.
Plot conditional residuals against time and fitted values; check their center and spread by marker and by relevant time ranges.
3
Check cross-marker dependence appropriately.
Use comparable times or a justified time adjustment, retain subject identifiers, and avoid treating all repeated pairs as independent.
4
Calibrate and follow up.
Use subject-level summaries, resampling, or simulation from the fitted model to judge whether a pattern is larger than expected. Refit a scientifically plausible alternative and check whether the diagnostic improves.

Different residual approaches emphasize different features. Conditional residuals assess remaining discrepancies after subject-specific effects; marginal residuals also reflect between-subject heterogeneity. Standardized residuals put markers on a variance-adjusted scale, while raw residuals preserve the measurement units and can make practical magnitudes easier to understand. Simulation-based residual checks can accommodate complicated fitted covariance structures, but their conclusions depend on the model used to generate the reference data. No one plot or correlation replaces careful specification and substantive assessment.

There are important limitations. Sparse or irregular measurements can make time-specific residual spreads and cross-marker pairs difficult to assess. A handful of subjects can dominate a pooled correlation, and estimating many covariance features from limited data may be unstable. Residual checks can also have low power to reveal subtle misspecification. Finally, satisfactory longitudinal residual plots do not validate the survival component, establish that the assumed association between markers and event time is correct, or show that an observed marker relationship is causal.

Common Pitfall

  • Wrong reasoning: “The residual correlation across all observed values is large, so the model must have omitted cross-marker error covariance.”
  • Correction: The pooled correlation may reflect subject-level random effects, repeated observations, unequal measurement times, or fitted random-effect estimation. Check the model-implied covariance and examine appropriately matched or time-adjusted residual pairs while accounting for clustering by subject.
  • Wrong reasoning: “The residuals are standardized, so their variance must be exactly one in every small time group.”
  • Correction: Unit variance is a model-level expectation under the stated assumptions, not a guarantee for every small sample. Look for persistent patterns and use uncertainty-calibrated diagnostics rather than treating minor fluctuations as failures.
Key takeaway: A useful cross-marker residual check asks whether marker-specific residual means, spreads, and cross-marker associations are compatible with the fitted longitudinal mean and residual covariance, after accounting for repeated measurements and estimated random effects.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. If a model assumes independent conditional errors across two markers, what does a persistent positive correlation between appropriately paired conditional residuals suggest, and what does it not prove?
  2. Residual standard deviations are \(1.2\) early and \(1.8\) late. What is the ratio of the late to early sample variances?
  3. Why can residuals based on estimated subject-specific random effects be correlated even when the conditional errors are independent?
  4. Why is a pooled cross-marker correlation across every recorded measurement potentially misleading when subjects have repeated, irregularly timed observations?

Solutions. (1) It suggests possible remaining cross-marker dependence or another aspect of model misfit, but it does not prove that the conditional residual covariance is misspecified; estimation, timing, and repeated observations also affect the diagnostic. (2) The variance ratio is \(1.8^2/1.2^2=3.24/1.44=2.25\); the late sample variance is 2.25 times the early sample variance. (3) Plug-in residuals include the random-effect estimation discrepancy \(Z_i(b_i-\widehat b_i)\), which can induce dependence across marker residuals. (4) Subjects contribute different numbers of observations, times may not align, and measurements within a subject are dependent, so a naive pooled correlation can mix these features with residual association.

Clinical Biostats