Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Building a Validation Cohort With Censored Outcomes

Calibration and Prediction Validation · Tutorial 549 of 697

Building a Validation Cohort With Censored Outcomes

Build a validation dataset that pairs each joint-model prediction with only the history available at its prediction time and a correctly classified, possibly censored, future outcome.

Advanced 12 min read

What You'll Learn

  • Define a validation record for a prediction made at a landmark and evaluated at a fixed horizon.
  • Determine which individuals are eligible at the landmark.
  • Truncate longitudinal histories so no measurement after prediction time enters the record.
  • Distinguish an observed event, an observed event-free horizon, and an outcome unknown because of censoring.
  • Organize data with multiple prediction times without treating dependent records as separate people.
  • Check for leakage, inconsistent time origins, and incorrect handling of censoring.

Why Cohort Construction Matters

A validation prediction is meaningful only when its inputs and outcome correspond to the same prediction task. For a joint model, that means pairing a prediction made at a particular time with the longitudinal history available then, and with follow-up after that time. A future biomarker measurement cannot be used to validate a prediction made before it was observed. Nor does a person censored before the evaluation horizon have a known event-free outcome at that horizon.

The earlier material on choosing prediction times and horizons establishes the prediction landmark and the interval over which risk is predicted. Here the focus is building the records for that task. The goal is not to calculate a performance metric, but to ensure that every prediction, history, and outcome label is correctly aligned.

Definition: For individual \(i\), let \(T_i\) be the event time, \(C_i\) the right-censoring time, \(\tilde T_i=\min(T_i,C_i)\) the observed follow-up time, and \(\Delta_i=I(T_i\le C_i)\) the event indicator. At landmark \(t_0\), let \(h>0\) be the prediction horizon. A validation record represents an individual who is event-free and under observation at \(t_0\), their longitudinal history and covariates available by \(t_0\), a prediction of event risk over \((t_0,t_0+h]\), and the follow-up information used to determine whether the event by that horizon is known.

Define the Record Before Selecting People

For a joint-model prediction, write the predicted conditional event risk as \(q_i(t_0,h)=P(T_i\le t_0+h\mid T_i>t_0,\mathcal H_i(t_0),X_i)\). Here \(\mathcal H_i(t_0)\) denotes the longitudinal history available through \(t_0\), and \(X_i\) denotes the relevant baseline or other covariates available at that time. Equivalently, the risk is one minus the model's conditional survival probability over the horizon. The prediction is conditional on having survived to the landmark; it is not the probability of an event from the study's original time zero.

The natural unit of the validation data is a person-landmark record. If each person has one prespecified landmark, there is one record per person. If predictions are assessed at several landmarks, one person may contribute several records; each record must have its own time-truncated history, prediction, and follow-up outcome. The records from one person are not independent observations merely because they occupy separate rows.

Eligibility must be determined using follow-up through the landmark, not by requiring a person to remain event-free beyond the landmark. Include an individual only if they are known to be event-free at \(t_0\) and under observation at \(t_0\). Under a continuous-time convention, this means \(T_i>t_0\) and \(C_i\ge t_0\). State a tie rule when event and censoring times can coincide; here, an event at a tied time is counted as observed when \(T_i\le C_i\). People who experienced the event before or at the landmark are not at risk for this prediction task. A person censored before the landmark cannot be confirmed eligible.

Definition: The landmark history \(\mathcal H_i(t_0)\) consists only of longitudinal measurements with measurement times \(t_{ij}\le t_0\), together with any covariates genuinely available by \(t_0\). Measurements after \(t_0\) must not be used as prediction inputs, even if they are present in the final study file.

The time origin also needs to be consistent. If the event times are recorded from study entry, then the horizon endpoint is \(t_0+h\), not simply \(h\). One may store the landmark-relative follow-up time \(\tilde T_i-t_0\), but the conversion to and from the study time scale must be explicit. Mixing the two scales can assign the right event to the wrong prediction window.

What Censoring Tells You About the Horizon Outcome

Let \(Z_i(t_0,h)=I(t_0<T_i\le t_0+h)\) be the binary event outcome for the prediction task. This outcome is not always observed. If an event is observed after the landmark and no later than the horizon endpoint, then \(Z_i=1\) is known. If the individual is observed event-free through the endpoint, then \(Z_i=0\) is known. If follow-up ends by censoring before the endpoint without an observed event, the data do not reveal whether the event would have occurred before the horizon.

$$ K_i(t_0,h)= \begin{cases} 1, & \Delta_i=1 \text{ and } t_0<\tilde T_i\le t_0+h,\\ 1, & \tilde T_i\ge t_0+h \text{ and no event occurred by } t_0+h,\\ 0, & \Delta_i=0 \text{ and } t_0<\tilde T_i<t_0+h, \end{cases} \qquad Z_i(t_0,h)= \begin{cases} 1, & \Delta_i=1 \text{ and } t_0<\tilde T_i\le t_0+h,\\ 0, & K_i(t_0,h)=1 \text{ and no event occurred by } t_0+h. \end{cases} $$

Here \(K_i=1\) indicates that the horizon outcome is known; when \(K_i=0\), the outcome label must be recorded as unknown, not as zero. The displayed cases use the stated event-first tie convention: an event at the horizon endpoint counts as an event by the horizon. In actual data, specify the operational rule for tied event and censoring times and apply it consistently. Censoring before the endpoint is not itself evidence of an event, and it is not evidence of being event-free through the endpoint.

This distinction is central to cohort construction. The prediction table can contain the model's risk for every eligible person-landmark record, while the observed binary outcome is available only for records with \(K_i=1\). The next tutorial addresses censoring-adjusted evaluation; assigning a false binary outcome here would not solve the missing-outcome problem.

A Reliable Construction Sequence

1
Fix the prediction task.
Record the landmark \(t_0\), horizon \(h\), time origin, and event definition. The endpoint is \(t_0+h\) on the study time scale.
2
Form the landmark risk set.
Keep individuals known to be event-free and under observation at \(t_0\). Do not select them based on whether they survive to \(t_0+h\).
3
Truncate prediction inputs.
For each retained person, include only measurements and covariates available by \(t_0\), then calculate or retrieve the prediction for that record.
4
Classify follow-up through the endpoint.
Mark an observed event by \(t_0+h\) as \(Z=1\); mark observed event-free follow-up through the endpoint as \(Z=0\); mark earlier censoring without an event as unknown.
5
Audit record identity and provenance.
Store the person identifier, landmark, horizon, history cutoff, prediction, event/censoring times, and outcome-known indicator. Preserve the validation split and do not use validation outcomes to generate predictions.

Worked Construction Examples

Worked Example: Classifying Horizon Outcomes

Suppose a hypothetical validation task predicts event risk at landmark \(t_0=2\) years over horizon \(h=3\) years. Thus the endpoint is \(2+3=5\) years from study entry. Four eligible individuals have the following follow-up:

Person\(\tilde T_i\) (years)\(\Delta_i\)Interpretation by year 5
A3.41Observed event
B5.80Observed event-free through year 5
C4.10Censored before year 5
D5.01Event at the endpoint

For A, \(2<3.4\le5\) and \(\Delta_A=1\), so \(K_A=1\) and \(Z_A=1\). For B, censoring occurs after the endpoint: \(5.8\ge5\), so the individual is known event-free through year 5, giving \(K_B=1\) and \(Z_B=0\). For C, censoring occurs at \(4.1<5\) without an observed event. Follow-up after year 4.1 is unknown, so \(K_C=0\) and no binary \(Z_C\) should be assigned. For D, the event occurs at the endpoint and is counted under the stated rule: \(2<5\le5\), so \(K_D=1\) and \(Z_D=1\).

Thus three of the four records have known horizon outcomes, but only two are observed events. Reporting C as event-free would add information that the follow-up does not contain.

Worked Example: Truncating a Longitudinal History

A hypothetical patient has biomarker measurements at study times 0.5, 1.4, 2.2, and 3.0 years. A prediction is made at \(t_0=2.0\) years for the next 2 years. The fitted joint model returns a conditional event-risk prediction of \(0.18\) using the available history and baseline covariates.

The eligible history is the set of measurements with \(t_{ij}\le2.0\): the measurements at 0.5 and 1.4 years. The values at 2.2 and 3.0 years are excluded because both occur after prediction time. The prediction record therefore stores \(t_0=2.0\), \(h=2.0\), endpoint \(t_0+h=4.0\), the two eligible measurements, and predicted risk \(q_i(2,2)=0.18\).

Suppose the patient is censored at year 3.5 without a recorded event. Since \(2.0<3.5<4.0\), the outcome by year 4 is unknown: \(K_i(2,2)=0\). The risk prediction remains a valid prediction record, but a fully observed binary outcome is not available for it. Using the biomarker measured at year 2.2 would be leakage: it changes the information set after the prediction has supposedly been made.

Worked Example: Creating Separate Records at Multiple Landmarks

In a hypothetical study, a patient is event-free and observed at landmarks 1 and 2 years. The validation task uses a 2-year horizon at each landmark. Measurements occur at 0.6, 1.5, and 2.4 years; the event occurs at year 3.2.

At landmark 1, the endpoint is \(1+2=3\) years. The history includes only the measurement at 0.6 years. The event at 3.2 is after the endpoint, and the patient is observed beyond year 3, so the horizon outcome is known to be \(Z=0\).

At landmark 2, the endpoint is \(2+2=4\) years. The history includes measurements at 0.6 and 1.5 years, but not the measurement at 2.4 years. The event at 3.2 falls in \((2,4]\), so this record has \(Z=1\). The patient contributes two records with different prediction times, horizons on the study time scale, histories, and outcomes. The two rows share a person identifier and are therefore dependent; later evaluation methods must respect that structure where required.

Checks, Comparisons, and Limitations

A useful audit is to verify, row by row, that the prediction landmark precedes every included event time; every longitudinal measurement time is at or before the landmark; and the endpoint equals \(t_0+h\). Then verify that every known zero has documented event-free observation through the endpoint, while every unknown outcome corresponds to censoring before the endpoint without an observed event. The number of eligible records should not depend on future survival beyond \(t_0\).

For validation data, a landmark-based table is preferable to a single static row per person when predictions are updated over time: it makes the prediction time and permitted history explicit. A single-row dataset can be appropriate when there is exactly one prediction landmark per person, but it can obscure time alignment if multiple prediction times are collapsed. Neither layout justifies coding early censoring as no event. A separate event-time-and-censoring representation preserves more information than a binary outcome column alone, so retain \(\tilde T_i\) and \(\Delta_i\) even when a horizon-specific label is also stored.

Cohort construction cannot correct an inappropriate prediction target, an incorrectly fitted joint model, or a validation sample that is not representative of the intended use population. It also does not, by itself, account for the selection induced by censoring before a horizon. The censoring mechanism and the method used to evaluate predictions require additional assumptions and methods. In particular, do not silently drop all censored records and interpret the remaining set as if it were necessarily representative.

Common pitfall: “No event is recorded before the horizon, so the outcome is zero.” This is wrong when follow-up ended before the horizon. The correction is to distinguish a known event-free outcome from an unknown outcome: only documented event-free observation through the endpoint supports \(Z=0\).

Check Your Understanding

For each item, state the cohort-construction decision and compare it with the solution below.

  1. At \(t_0=4\) years with \(h=2\) years, a person is censored at year 5 without an event. Is the horizon outcome known?
  2. A prediction is made at year 1.8. The biomarker was measured at years 1.0, 1.7, and 2.1. Which measurements belong in the prediction history?
  3. At landmark year 3, an observed event occurs at year 4.2 and the horizon is 2 years. What is the horizon outcome?
  4. Why should people who experience the event before the landmark not be included in the landmark risk set?
  5. A person contributes prediction rows at two landmarks. What information should link the rows, and what dependence issue should be remembered?

Solutions. (1) No. The endpoint is \(4+2=6\), and censoring at year 5 is before it; without an observed event the outcome is unknown. (2) Include the measurements at 1.0 and 1.7 years; exclude 2.1 because it is after prediction time. (3) The endpoint is \(3+2=5\), and \(3<4.2\le5\), so the known outcome is \(Z=1\). (4) They are not event-free at the prediction time and therefore are not at risk for the conditional prediction target. (5) Retain a common person identifier and the distinct landmark for each row; records from one person are dependent, not independent people.

Clinical Biostats