Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Cumulative-Dynamic ROC Curves

Calibration and Prediction Validation · Tutorial 552 of 697

Cumulative-Dynamic ROC Curves

Learn to define horizon-specific cases and controls and estimate their ROC curve when event times are censored, including how the censoring weights depend on the boundary convention.

Advanced 12 min read

What You'll Learn

  • Define cumulative cases and dynamic controls at a fixed horizon.
  • Interpret sensitivity and false-positive rate for a survival risk score.
  • Construct an inverse-probability-of-censoring-weighted ROC curve.
  • Distinguish censoring weights for observed events from weights for observed controls.
  • Check conditional independence, positivity, and censoring-model adequacy.
  • Recognize how changing the horizon or case definition changes the ROC curve.

Why a Survival ROC Curve Needs a Time Horizon

A survival prediction is not simply a classification: at the prediction landmark, some people will experience the event later, and others may remain event-free beyond the follow-up available. To assess whether predicted risks rank people usefully, first specify a horizon \(\tau\). The resulting ROC curve compares people who experience the event by \(\tau\) with those who remain event-free past \(\tau\). Because censoring can prevent either status from being observed, the curve generally needs censoring adjustment.

Consider a validation cohort that has reached a prediction landmark, such as a clinic visit at which each person’s joint-model prediction is made. Measure \(T\) as time from that landmark to the event of interest, and \(C\) as time from the same landmark to censoring. A person’s fixed-horizon risk score, denoted \(R\), is calculated using information available at the landmark; a larger score means greater predicted event risk by \(\tau\). For example, a joint model might supply a predicted probability of event by \(\tau\) conditional on the person’s observed longitudinal history and survival to the landmark. The prediction itself is held fixed during validation.

Definition: At horizon \(\tau\), a cumulative case is a person with \(T\leq\tau\). A dynamic control is a person with \(T>\tau\). For a threshold \(c\), sensitivity is \(P(R\geq c\mid T\leq\tau)\), and the false-positive rate is \(P(R\geq c\mid T>\tau)\). The cumulative-dynamic ROC curve plots the false-positive rate against sensitivity as \(c\) varies.

“Cumulative” refers to the cases: they include events occurring at any time from the landmark through \(\tau\), not just events close to \(\tau\). “Dynamic” refers to the controls: a person is a control only if they remain event-free beyond the chosen horizon. These definitions are tied to the specified landmark, target population, event, and horizon. Changing \(\tau\) can change both the case and control groups and therefore the ROC curve.

What Censoring Leaves Observable

Write \(Y=\min(T,C)\) for observed follow-up time and \(\Delta=I(T\leq C)\) for the event indicator. An observed event by \(\tau\), \(\Delta=1\) and \(Y\leq\tau\), identifies a cumulative case. A person with \(Y>\tau\) is an observed dynamic control: both \(T>\tau\) and \(C>\tau\). By contrast, censoring before \(\tau\) without an event leaves the person’s case/control status at \(\tau\) unknown. Treating every such person as a control, or excluding them without adjustment, can distort the curve.

Let \(W\) denote the variables used to model censoring, measured or constructed from information available for the prediction and censoring analysis. In particular, \(W\) must include the score \(R\), or the relevant longitudinal history and predictors that determine \(R\), if censoring may depend on them. Define the censoring survival function using the convention \(G(u\mid W)=P(C\geq u\mid W)\). For controls, also define the right-limit probability \(G(\tau+\mid W)=P(C>\tau\mid W)\).

Assumptions for the inverse-censoring-weighted curve: The censoring model is correctly specified (or consistently estimated) conditional on \(W\); \(T\) and \(C\) are conditionally independent given \(W\); and censoring probabilities are positive for the event times and horizon being evaluated. The score is fixed from landmark information, and the cohort and horizon define the target population. Events tied with censoring are assigned to the event, as in \(\Delta=I(T\leq C)\). Consequently, an observed event at time \(T\) has observation probability \(G(T\mid W)\), whereas an observed control requires \(C>\tau\) and has probability \(G(\tau+\mid W)\).

The conditional independence assumption is important for score-based comparisons, not merely for estimating an overall censoring curve. Conditional on \(W\), censoring must not carry additional information about event time. If censoring is associated with the score or longitudinal history after conditioning on the variables in the censoring model, the weights need not recover the intended case and control distributions. Positivity means the relevant \(G(T\mid W)\) and \(G(\tau+\mid W)\) are not zero; in practice, very small values also make estimates unstable.

Constructing the Weighted ROC Curve

An observed case contributes the inverse probability \(1/G(Y\mid W)\). An observed control contributes \(1/G(\tau+\mid W)\). The two weights differ because the events defining observability differ. If censoring is continuous at \(\tau\), then \(P(C>\tau\mid W)=P(C\geq\tau\mid W)\), so the distinction at the boundary has no numerical effect. If censoring can have an atom at \(\tau\), the right-limit probability is required for controls under the definition \(Y>\tau\).

With an estimated censoring survival function \(\widehat G\), the empirical weighted sensitivity and false-positive rate at threshold \(c\) are ratios of weighted counts:

$$ \widehat{\mathrm{Se}}(\tau,c)= \frac{\displaystyle\sum_{i=1}^{n} \frac{I(\Delta_i=1,\ Y_i\leq\tau)\,I(R_i\geq c)} {\widehat G(Y_i\mid W_i)}} {\displaystyle\sum_{i=1}^{n} \frac{I(\Delta_i=1,\ Y_i\leq\tau)} {\widehat G(Y_i\mid W_i)}}, \qquad \widehat{\mathrm{FPR}}(\tau,c)= \frac{\displaystyle\sum_{i=1}^{n} \frac{I(Y_i>\tau)\,I(R_i\geq c)} {\widehat G(\tau+\mid W_i)}} {\displaystyle\sum_{i=1}^{n} \frac{I(Y_i>\tau)} {\widehat G(\tau+\mid W_i)}}. $$

Here \(I(\cdot)\) is 1 when its condition holds and 0 otherwise. Each weighted numerator counts observed cases or controls above the score threshold; each denominator represents the corresponding weighted group total. Plotting \(\widehat{\mathrm{Se}}(\tau,c)\) vertically against \(\widehat{\mathrm{FPR}}(\tau,c)\) horizontally over thresholds produces a step curve. The threshold convention \(R\geq c\) handles ties consistently. Raising \(c\) generally makes fewer people test positive; the finite-sample curve is a sequence of points, not necessarily a smooth line.

Why the Censoring Weights Work

The justification is that inverse weighting corrects for the probability that an otherwise relevant person is observed. For a case, let \(f(T,R,W)\) be any bounded contribution determined by event time, score, and \(W\). Conditional independence given \(W\) implies that, conditional on \(T,R,W\), the probability the event is observed is \(G(T\mid W)\). Thus:

$$ E\!\left[ \frac{I(C\geq T)}{G(T\mid W)} f(T,R,W) \,\middle|\,T,R,W \right] = \frac{f(T,R,W)}{G(T\mid W)} P(C\geq T\mid T,R,W) = f(T,R,W). $$

The conditioning includes \(R\), or \(W\) must determine \(R\), so the argument applies to contributions such as \(I(R\geq c)\). It follows that weighting observed events recovers the case contribution that would have been available without censoring. For controls, the observation indicator is \(I(C>\tau)\), not \(I(C\geq\tau)\). The corresponding calculation is:

$$ E\!\left[ \frac{I(C>\tau)}{G(\tau+\mid W)} f(R,W) \,\middle|\,T>\tau,R,W \right] = \frac{f(R,W)}{G(\tau+\mid W)} P(C>\tau\mid T>\tau,R,W) = f(R,W). $$

These identities explain the weighted ratios: their numerators and denominators estimate the target case or control totals, respectively. The ratios are finite-sample estimates, so they are not exactly unbiased in every sample; their justification is consistency under the stated assumptions and suitable regularity conditions. The censoring probabilities are typically estimated using the chosen censoring model, not assumed known.

Worked Example: Classifying People at a Fixed Horizon

Suppose a hypothetical validation cohort is assessed at a landmark, and the chosen horizon is \(\tau=2\) years. Consider four people: A has an observed event at 1.4 years; B is event-free and observed for 2.6 years; C is censored at 1.1 years without an event; and D has an observed event at 2.0 years. Under the convention \(\Delta=I(T\leq C)\), classify their observed status.

A is an observed cumulative case because \(\Delta=1\) and \(Y=1.4\leq2\). D is also an observed cumulative case: an event at the horizon satisfies \(T\leq\tau\). B is an observed dynamic control because \(Y=2.6>2\). C cannot be classified as a case or control: the event status after 1.1 years is unknown.

The censoring weight for A or D uses \(G(Y\mid W)\), since an event is observed when censoring has not occurred before that event time under the stated tie convention. B’s control weight uses \(G(2+\mid W)\), since an observed control must remain uncensored past 2 years. C receives neither observed-group contribution; inverse weighting of the observed cases and controls accounts for comparable people who were censored earlier, subject to the assumptions.

Worked Example: Computing One Weighted ROC Point

Consider a hypothetical validation sample at horizon \(\tau=2\) years. The table lists three observed cases, three observed controls, and one person censored before the horizon. The weights are supplied by a correctly specified censoring model conditional on \(W\), including the score or the history determining it. The score is a predicted risk, with larger values indicating higher risk.

PersonObserved statusScore \(R\)Inverse censoring weight
ACase, event at 0.8 years0.901.25
BCase, event at 1.5 years0.702.00
CCase, event at 2.0 years0.401.25
DControl, observed beyond 2 years0.852.00
EControl, observed beyond 2 years0.601.25
FControl, observed beyond 2 years0.302.00
GCensored at 1.2 years, no event observed0.95—

At threshold \(c=0.65\), cases A and B exceed the threshold, with total weight \(1.25+2.00=3.25\). The total case weight is \(1.25+2.00+1.25=4.50\). Therefore:

$$ \widehat{\mathrm{Se}}(2,0.65)=\frac{3.25}{4.50}=0.7222. $$

Among controls, only D exceeds 0.65, so the weighted false-positive rate is \(2.00/(2.00+1.25+2.00)=2.00/5.25=0.3810\). The specificity is \(1-0.3810=0.6190\). Thus the ROC point is approximately \((0.381,0.722)\): at this threshold, the estimated sensitivity is 72.2% and the estimated false-positive rate among dynamic controls is 38.1%. Person G is not assigned to either group because censoring occurred before the horizon.

Worked Example: Why the Censoring Model Must Account for the Score

Suppose, hypothetically, that the target cumulative-case group contains 100 people with high scores and 100 with low scores. Assume events in both score groups occur by the horizon, but the probabilities that those events are observed are 0.90 for high-score people and 0.50 for low-score people. This difference arises because censoring depends on score or the longitudinal history that generates it.

Without adjustment, the expected observed case counts are \(100(0.90)=90\) high-score cases and \(100(0.50)=50\) low-score cases. At a threshold that classifies only the high scores as positive, the unweighted sensitivity is therefore \(90/(90+50)=0.6429\), rather than the target value \(100/(100+100)=0.5000\).

If the censoring model conditions on score (or sufficient history) and its probabilities are correct, the inverse weights are \(1/0.90=1.111\) for high-score cases and \(1/0.50=2.000\) for low-score cases. The expected weighted counts are \(90(1.111)\approx100\) and \(50(2.000)=100\). The resulting sensitivity is \(100/(100+100)=0.5000\). A censoring model that omits the score-dependent difference cannot generally make this correction. The calculation depends on the hypothetical assumption that the stated observation probabilities correctly apply within score groups.

Diagnostics, Alternatives, and Limitations

Before interpreting the curve, check whether its assumptions and estimates are credible. Inspect the fitted censoring survival probabilities at observed event times and at \(\tau+\), overall and across relevant values of \(W\). Very small probabilities create large weights, so a few people can dominate a point on the curve. Examine weight distributions and effective contribution by score range; investigate whether the censoring model has enough information and whether important censoring predictors, including longitudinal history when relevant, have been omitted. If some target-group members have essentially no chance of remaining observed, positivity fails and the data cannot reliably identify the full-cohort curve through weighting alone.

A complete-case curve uses only people whose status at \(\tau\) is observed, but it can be biased when observation depends on score or event-related predictors. Treating everyone censored before \(\tau\) as a control is also incorrect: their event status by \(\tau\) is unknown. The inverse-weighted cumulative-dynamic curve instead estimates performance in the specified target cohort under conditional independent censoring and positivity. It does not repair a misspecified censoring model or unmeasured dependence between censoring and event time after conditioning on \(W\).

The case definition also matters. A cumulative-dynamic curve includes all events by the horizon; the incident-dynamic approach uses a different case definition, focused on events around a time point. They answer different discrimination questions and should not be treated as interchangeable. The horizon-specific curve is not a summary of calibration: it describes ranking at a threshold, not whether predicted risks agree with observed event probabilities. Its estimates can be imprecise when there are few observed cases or controls, and the censoring weights add uncertainty. Choosing a different horizon changes the target comparison, rather than merely changing a tuning parameter.

Key takeaway: Define cases as \(T\leq\tau\) and controls as \(T>\tau\) before calculating the curve. Weight observed events by \(1/G(Y\mid W)\), but observed controls by \(1/G(\tau+\mid W)\) when controls require \(Y>\tau\). The censoring model must account for score-related censoring and have adequate positivity.

Check Your Understanding

Answer each question using the stated horizon and observation convention.

  1. At \(\tau=3\) years, a person has an observed event at 3 years. Is this person a cumulative case, a dynamic control, or unclassified?
  2. For observed controls defined by \(Y>\tau\), which censoring probability belongs in the inverse weight: \(P(C\geq\tau\mid W)\) or \(P(C>\tau\mid W)\)? Why?
  3. At a threshold, the total weighted case contribution is 12, of which 9 has a score at least as large as the threshold. The corresponding control contributions are 20 in total and 5 above the threshold. Calculate sensitivity and false-positive rate.
  4. Why might a censoring model that omits longitudinal history bias a score-based ROC curve, even if it estimates overall censoring reasonably well?

Solutions. (1) A cumulative case, because the definition includes \(T\leq\tau\). (2) Use \(P(C>\tau\mid W)\): \(Y>\tau\) requires \(C>\tau\), including when censoring can occur exactly at \(\tau\). (3) Sensitivity is \(9/12=0.750\); the false-positive rate is \(5/20=0.250\). (4) If censoring depends on the history that determines the score, then observation probabilities can differ across scores. A model omitting that history may fail to recover the score-specific case and control distributions; conditional independence must hold given the variables used in the censoring model.

Clinical Biostats