Tutorials › Competing Risks and Multi-State Models › Schoenfeld Residual Diagnostics by Transition

Regression for Multi-State Data · Tutorial 363 of 699

Schoenfeld Residual Diagnostics by Transition

Learn how transition-specific Schoenfeld residuals arise from the partial-likelihood score and how to interpret time trends without pooling distinct transitions.

Advanced 13 min read

What You'll Learn

  • Define a Schoenfeld residual for a covariate at an event on a specified transition.
  • Derive the residual from the transition-specific partial-likelihood score.
  • Check transition risk sets, covariate values, event ties, and model assumptions before interpreting a plot.
  • Use residual patterns and time interactions to assess proportional hazards for individual covariates.
  • Distinguish transition-specific diagnostics from pooled diagnostics and direct time-varying-coefficient models.

Why Diagnose Proportional Hazards by Transition?

In a multi-state model, one covariate can have different effects on different transitions, and its effect on a given transition may also change over time. A diagnostic that pools events from several transitions can hide both kinds of variation. Schoenfeld residuals provide a transition-specific way to compare the covariate value observed at an event with the risk-set-weighted value expected under the fitted proportional-hazards model. Examining those residuals against event time helps reveal departures from a constant coefficient.

The diagnostic is about the adequacy of a model for a particular transition and covariate, not about whether that covariate is important in general. A pattern can suggest that a time-constant coefficient is inadequate; it does not, by itself, identify the correct replacement model or establish a causal explanation.

Model, Risk Set, and Residual Definition

Let \(r\) denote a permitted transition, \(i\) a subject, and \(Y_{ir}(t)\) indicate that subject \(i\) is under observation and at risk of making transition \(r\) just before time \(t\). Write \(x_i(t)\) for the covariate vector available at that time. A transition-specific proportional-hazards model has intensity

$$ \lambda_{ir}(t\mid x_i(t))= Y_{ir}(t)\lambda_{0r}(t)\exp\{\beta_r^\mathsf{T}x_i(t)\}. $$

Here \(\lambda_{0r}(t)\) is the baseline hazard for transition \(r\), and \(\beta_r\) is constant over time under the proportional-hazards assumption. The notation permits transition-specific coefficients: the model for another transition can have a different coefficient vector. The diagnostic is applied within the risk set for the transition that generated each event.

Definition: At an event time \(t_j\) for transition \(r\), the Schoenfeld residual for that event is the observed covariate vector of the subject making the transition minus its risk-set-weighted mean under the fitted model: $$ \widehat{r}_{rj} = x_{i_j}(t_j) - \frac{\sum_{i\in R_r(t_j)}x_i(t_j)\exp\{\widehat{\beta}_r^\mathsf{T}x_i(t_j)\}} {\sum_{i\in R_r(t_j)}\exp\{\widehat{\beta}_r^\mathsf{T}x_i(t_j)\}}. $$ Here \(R_r(t_j)\) is the risk set for transition \(r\) immediately before \(t_j\), and \(i_j\) is the subject making that transition. Each component of the vector is a residual for one covariate.

This definition assumes a single transition event at \(t_j\). If event times are tied, a residual calculation must be consistent with the tie method used to fit the partial likelihood; the single-event formula should not be applied unchanged to tied events. With time-dependent covariates, use each subject’s covariate value at the relevant event time. For a transition that can occur repeatedly, each event contribution uses the appropriate risk set and covariate history.

Why the Residual Has This Form

For one transition \(r\), suppose event times are distinct. Conditional on one event occurring at \(t_j\) among those in \(R_r(t_j)\), the partial-likelihood contribution is proportional to the event subject’s relative hazard. Its log contribution is

$$ \ell_{rj}(\beta_r) = \beta_r^\mathsf{T}x_{i_j}(t_j) - \log\left\{\sum_{i\in R_r(t_j)} \exp\bigl(\beta_r^\mathsf{T}x_i(t_j)\bigr)\right\}. $$

Differentiating with respect to \(\beta_r\) gives

$$ \frac{\partial\ell_{rj}(\beta_r)}{\partial\beta_r} = x_{i_j}(t_j) - \frac{\sum_{i\in R_r(t_j)}x_i(t_j)\exp\{\beta_r^\mathsf{T}x_i(t_j)\}} {\sum_{i\in R_r(t_j)}\exp\{\beta_r^\mathsf{T}x_i(t_j)\}}. $$

Thus the Schoenfeld residual is exactly the event’s contribution to the partial-likelihood score, evaluated at the fitted coefficient. The weighted mean is not generally the unweighted risk-set average: subjects with larger fitted relative hazards receive greater weight. At the true coefficient, the model assigns each at-risk subject an event probability proportional to \(\exp\{\beta_r^\mathsf{T}x_i(t_j)\}\). Averaging the event subject’s covariate over those probabilities gives precisely the weighted mean in the definition. The residual therefore compares the observed event with what the fitted model expected at that event time.

Worked Example: Computing a Binary-Covariate Residual

Consider a hypothetical event on transition \(r\). At time \(t=2\), three subjects are at risk. Their binary covariate values are \(0,1,1\). Suppose the fitted coefficient is \(\widehat{\beta}_r=\log(2)\), and a subject with covariate value \(1\) makes the transition. Calculate the residual.

The fitted relative hazard weights are \(1\) for a subject with covariate \(0\), and \(\exp\{\log(2)\}=2\) for each subject with covariate \(1\). The weighted mean covariate is

$$ \frac{0(1)+1(2)+1(2)}{1+2+2} = \frac{4}{5} = 0.8. $$

The observed covariate is \(1\), so the Schoenfeld residual is \(1-0.8=0.2\). It is positive because the subject making the transition had a higher covariate value than the fitted, risk-set-weighted expectation. This is one event contribution, not by itself evidence that the coefficient changes over time.

Using Event Time to Assess a Constant Coefficient

Under proportional hazards, the coefficient \(\beta_r\) does not vary with time. If the effect of a covariate actually changes, event subjects may tend to have covariate values that are systematically higher or lower than the model’s risk-set-weighted expectations at some times. The corresponding Schoenfeld residuals may then show a pattern when plotted against event time.

A practical diagnostic is to make a separate plot for each transition and covariate: place the event time on the horizontal axis and the residual component on the vertical axis. A smooth curve can help distinguish an overall trend from event-to-event scatter. A roughly level pattern around zero is compatible with proportional hazards, though it does not prove the assumption. A sustained rise, fall, or other structured pattern is a warning that a constant coefficient may not describe the transition adequately. Examine the number and timing of events as well: a smooth curve based on a few late events can be unstable.

The connection to a formal check can be seen by allowing one coefficient to vary with a chosen time function \(g(t)\), such as \(g(t)=t\) or \(g(t)=\log(t)\):

$$ \beta_{rk}(t)=\beta_{rk}+\gamma_{rk}g(t). $$

The proportional-hazards null for this covariate is \(H_0:\gamma_{rk}=0\). At \(\gamma_{rk}=0\), the score for \(\gamma_{rk}\) is the time-weighted sum of the covariate’s Schoenfeld residuals:

$$ U_{\gamma_{rk}}(0) = \sum_{j:\,\text{transition }r}g(t_j)\widehat{r}_{rjk}. $$

The intuition is direct: residuals later in time receive different weights from earlier residuals according to \(g(t)\). A formal score test uses the fitted model’s information, including the adjustment for estimating the constant coefficient and other nuisance parameters; the residual sum alone is not a p-value. The choice of \(g(t)\) matters, because a test aimed at a linear trend can miss a different time pattern. Residual plots can help identify patterns that a single prechosen transformation does not capture.

Worked Example: A Residual Trend Within One Transition

In a hypothetical fitted model for transition \(r\), suppose a binary covariate has \(\widehat{\beta}_r=0\). At four event times, each risk set contains five subjects. The numbers with covariate value \(1\), and the covariate value of the event subject, are as follows.

Event timeNumber with covariate 1 in risk setEvent subject’s covariateResidual
130−0.60
210−0.20
3410.20
4210.60

Because \(\widehat{\beta}_r=0\), all subjects in a risk set have equal fitted weight. At time 1, the weighted mean is \(3/5=0.60\), so the residual is \(0-0.60=-0.60\). At time 2 it is \(0-1/5=-0.20\). At time 3 it is \(1-4/5=0.20\), and at time 4 it is \(1-2/5=0.60\). The residuals sum to zero, as expected for the fitted coefficient’s score in this simple model.

For a descriptive linear trend, their mean is zero and the mean event time is \(2.5\). The slope of residual on time is

$$ \frac{\sum_{j=1}^4(t_j-2.5)\widehat{r}_{rj}} {\sum_{j=1}^4(t_j-2.5)^2} = \frac{2.0}{5} = 0.40 \quad\text{residual units per time unit}. $$

The increasing residual sequence suggests that the constant-effect model may underpredict the event subject’s covariate value later in follow-up, relative to the risk-set expectation. This descriptive slope is not a calibrated test statistic. A formal conclusion would require an appropriate model-based test and uncertainty calculation.

Transition-Specific Interpretation and Assumptions

The residual definition and interpretation are conditional on having a suitable fitted transition model. Check that each event was assigned to the correct transition, that the risk set includes exactly those eligible to make that transition at the event time, and that covariates are recorded on the correct scale and at the correct time. The transition intensity model must be an adequate description aside from the proportional-hazards feature being assessed. In particular, a wrong covariate form or an incorrectly specified risk set can create residual patterns that might be mistaken for time-varying effects.

The usual partial-likelihood reasoning also requires an appropriate event and censoring setup: censoring should not selectively remove subjects in a way that invalidates the risk-set comparison, conditional on the modeled information. With time-dependent covariates, their values must be available just before the event and treated consistently with the model. If a subject contributes multiple transition events, the event contributions are not automatically independent. Formal inference should use a variance calculation appropriate to the data structure; treating repeated contributions as independent can give misleading uncertainty.

Do not combine residuals from distinct transitions merely because they involve the same covariate. A trend on one transition can be diluted or cancelled by an opposite trend on another. Conversely, a pooled trend can arise from different transition compositions even when neither transition has the same within-transition pattern. If the scientific model imposes a shared coefficient across transitions, the fitted model’s constraints must be reflected in the diagnostic and its formal test; a transition-specific plot remains useful for seeing where lack of fit may occur.

Diagnostics, Alternatives, and Limitations

A residual plot is a diagnostic, not a proof. Random-looking residuals can occur when there are few events or little covariate variation in the risk sets. Extreme residuals may reflect a single unusual risk set rather than a sustained time trend. Conversely, a smooth curve can be sensitive to the smoothing method, especially near the boundaries where events are sparse. Inspect event counts and risk-set composition alongside the plot, and avoid interpreting small fluctuations as meaningful evidence.

A formal time-interaction test offers a quantified check for a specified pattern, but its conclusion depends on the chosen time function and the model-based variance. A direct model with a time-varying coefficient can estimate and describe a changing effect; it answers a modeling question beyond whether the constant-effect assumption appears adequate. These approaches complement the residual diagnostic rather than replacing the need to inspect transition-specific fit. Schoenfeld residuals primarily diagnose coefficient constancy; they are not a general test of every aspect of covariate or transition-model specification.

Common pitfall: “The residuals average to zero, so proportional hazards must hold.” The correction is that fitting a constant coefficient makes the overall score zero (or close to zero), but residuals can still move systematically from negative to positive over time. The diagnostic concerns their pattern against time, not merely their overall average.

Worked Example: Avoiding a Pooled Transition Diagnostic

Worked Example: Contrasting Two Transition Patterns

Suppose a hypothetical analysis produces the following mean Schoenfeld residuals for one binary covariate, calculated separately for early and late events. These are summaries for illustration, not real study results.

TransitionEarly-event mean residualLate-event mean residual
A to B−0.300.30
A to C0.25−0.25

For transition A to B, the mean changes from \(-0.30\) to \(0.30\), a rise of \(0.30-(-0.30)=0.60\). For transition A to C, it changes from \(0.25\) to \(-0.25\), a fall of \(-0.25-0.25=-0.50\). These opposite directions suggest that a pooled plot could obscure transition-specific patterns. The summaries motivate separate inspection and appropriately specified tests; they do not establish that either trend is statistically distinguishable from random variation. Nor do they prove that the covariate effect changes: risk-set composition and model specification must also be checked.

Check Your Understanding

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

  1. At an event on transition \(r\), the observed covariate is \(2\). The fitted risk-set-weighted mean is \(1.4\). What is the Schoenfeld residual, and what does its sign mean?
  2. For a binary covariate with fitted coefficient zero, a risk set has eight subjects, three with covariate value \(1\). A subject with value \(0\) makes the transition. Calculate the residual.
  3. Why is an overall residual sum near zero not enough to conclude that proportional hazards holds?
  4. Two transitions show opposite time trends in their residuals for the same covariate. What is the danger of pooling them?

Solutions. (1) The residual is \(2-1.4=0.6\). It is positive because the event subject’s value exceeds the fitted risk-set-weighted expectation at that time. (2) With coefficient zero, all weights are equal, so the weighted mean is \(3/8=0.375\). The residual is \(0-0.375=-0.375\). (3) The fitted score equation makes the residual contributions sum to zero overall, but positive late residuals can balance negative early residuals. Proportional hazards is assessed by the pattern over time, not just the total. (4) Pooling may cancel or conceal the within-transition trends, so diagnostics should be examined separately by transition, with formal inference matched to the fitted model.

Clinical Biostats