Tutorials › Competing Risks and Multi-State Models › External Validation Across Populations

Transition-Specific Prediction Validation · Tutorial 417 of 699

External Validation Across Populations

Assess whether a fixed multi-state prediction model performs well in a new population, without refitting it to that population’s outcomes.

Advanced 12 min read

What You'll Learn

  • Define an external validation target population and freeze the original model and prediction process.
  • Match transition-specific predictions to the observed outcome, time origin, and prediction horizon.
  • Summarize transition-specific performance with prediction error, observed-versus-predicted risk, and discrimination.
  • Account for competing transitions and censoring when evaluating outcomes at a fixed horizon.
  • Recognize design failures and limitations that can make external validation results misleading.

Why Validate Across Populations?

A prediction model may perform well in the population used to develop it and less well when applied elsewhere. The new population may differ in clinical setting, eligibility, follow-up, or the distribution of patient characteristics. External validation evaluates the model’s predictions in data from a distinct population to learn how well the model performs there. The model is applied as specified; its coefficients and prediction rules are not estimated again from the validation outcomes.

For a multi-state model, evaluation must be specific about the transition or state-occupation probability being predicted, the time origin, and the horizon. A predicted probability of a direct transition from state \(r\) to state \(s\) is not interchangeable with the probability of occupying state \(s\) at a later time, which may include indirect paths. The target in the validation data must match the model output. The earlier material on transition probabilities versus state-occupation probabilities provides the distinction; here, it is a design requirement for a fair external evaluation.

Definition: External validation across populations is the evaluation of a fixed prediction model, developed in one population, using predictions for individuals in a distinct target population and outcomes observed there. The model’s prediction function, coefficients, and required processing rules are held fixed. The validation estimates describe performance in the target population and at the specified prediction horizons.

The target population is defined by who could be included in the validation cohort and the setting in which the predictions would be used. Before looking at outcomes, specify eligibility, the prediction time, the state occupied at that time, the transitions of interest, the prediction horizon, and how censoring will be handled. A validation cohort is not automatically representative of every population in which the model might later be used.

Lock the Prediction and Define the Target

Suppose the model was developed to predict, for a person in state \(r\) at a specified time origin, the probability of a direct transition to state \(s\) within horizon \(h\). Write the model’s prediction for validation subject \(i\) as \(q_i(h)\). For this direct-transition target, define \(Y_i(h)=1\) if the target transition occurs by \(h\) before any competing first transition, and \(Y_i(h)=0\) if a competing first transition occurs by \(h\) or the person remains in the origin state through \(h\). If the prediction instead concerns being in state \(s\) at \(h\), the outcome indicator must represent that state-occupation event, including any paths allowed by the model. These are different validation questions.

The prediction must be produced using the original model and the same input definitions. This includes variable coding, units, missing-data rules, time origin, and any transformations required by the model. For example, changing the definition of a baseline covariate or estimating a new coefficient from validation outcomes means the evaluated procedure is no longer simply the fixed original model. Record predictions before examining validation outcomes where practicable, and retain enough information to reproduce them.

A valid comparison also requires that the validation data measure the relevant states and transition times consistently with the target. Subjects should enter at the prediction time and in the state to which the prediction applies. Follow-up must be long enough to observe outcomes at the chosen horizon, or censoring must be addressed appropriately. In a multi-state setting, competing transitions are outcomes that alter the probability of the target transition; they must not be treated as ordinary losses to follow-up.

Worked Example: Checking That the Validation Target Matches

A locked model predicts the probability that a patient in the post-operative state will enter a complication state directly within 30 days. In a hypothetical external cohort, each patient is followed from the same post-operative time origin. By day 30, 6 have entered the complication state directly, 3 have moved first to a competing state, and 11 have had neither transition. All 20 have complete 30-day outcome ascertainment.

For the model’s direct-transition target, the outcomes are 1 for the 6 direct transitions and 0 for the 3 competing transitions and 11 patients with neither transition. Thus there are 6 positive outcomes among 20 patients, and the observed proportion for this target is \(6/20=0.30\). The competing transitions count as non-cases for this particular direct-transition endpoint; they are not omitted.

If the model had instead predicted the probability of occupying the complication state on day 30, it would be wrong to use this direct-transition outcome definition without checking the paths. A patient who reached the complication state and then left it before day 30 may be a direct-transition case but not a day-30 occupant. The prediction target and the validation outcome must describe the same event.

Transition-Specific Performance Measures

For fully observed binary outcomes at a fixed horizon, the Brier score is the average squared difference between predicted probability and observed outcome. For \(n\) validation subjects with predictions \(q_i(h)\) and outcomes \(Y_i(h)\), it is

$$ \mathrm{BS}(h)=\frac{1}{n}\sum_{i=1}^{n}\{Y_i(h)-q_i(h)\}^{2}. $$

The score ranges from 0 to 1, with smaller values indicating better probability predictions. It combines aspects of calibration and discrimination, so it should not be interpreted as measuring either one alone. For multiple transitions, calculate or summarize performance separately for each transition target and horizon; a single pooled number can conceal poor performance on a clinically important, less frequent transition.

A useful descriptive comparison is the mean predicted probability against the observed event proportion for the same endpoint. With complete follow-up, these are \(\bar q(h)=n^{-1}\sum_i q_i(h)\) and \(\bar Y(h)=n^{-1}\sum_i Y_i(h)\). A difference \(\bar Y(h)-\bar q(h)\) above zero means the observed event proportion exceeds the average prediction in this cohort. This is an overall summary, not proof that every part of the probability range is well calibrated.

For a binary target with fully known outcomes, transition-specific discrimination can be summarized by an AUC: the probability that a randomly selected case has a higher predicted probability than a randomly selected non-case, with half credit for ties. The cases and non-cases must be defined for the same transition and horizon as the predictions. A high AUC does not establish that the probability values are accurate: predictions can rank individuals well while systematically overpredicting or underpredicting risk.

Worked Example: Brier Score and Mean Prediction

Suppose a fixed model gives four hypothetical patients probabilities \(0.20, 0.40, 0.60,\) and \(0.80\) of a specified transition by 30 days. All outcomes are observed: \(Y=(0,1,1,0)\). The Brier score is

$$ \mathrm{BS}(30)=\frac{(0-0.20)^2+(1-0.40)^2+(1-0.60)^2+(0-0.80)^2}{4} =\frac{0.04+0.36+0.16+0.64}{4} =0.30. $$

The average prediction is \((0.20+0.40+0.60+0.80)/4=0.50\). The observed proportion is \(2/4=0.50\), so the overall observed-minus-predicted difference is zero. That agreement does not make the predictions perfect: the Brier score is 0.30, and the individual predictions still differ from their outcomes. Nor does agreement of these two averages establish calibration throughout the risk range.

The Brier score has a useful justification as a probability score. If the true event probability for a subject with given information is \(p\), then \(Y\) is binary with \(P(Y=1)=p\). The expected squared error for a proposed prediction \(q\) is

$$ \begin{aligned} E\{(Y-q)^2\} &=p(1-q)^2+(1-p)q^2\\ &=p(1-p)+(q-p)^2. \end{aligned} $$

The first term does not depend on \(q\), and the second is nonnegative, reaching its minimum when \(q=p\). Thus, in expectation, the Brier score rewards reporting the true probability rather than shifting predictions systematically away from it. In a finite external cohort, however, its value also reflects the cohort’s outcome frequency and case mix.

Censoring and Uncertainty

If a subject is censored before horizon \(h\) without a target or competing transition, \(Y_i(h)\) is unknown. Coding that subject as a non-case biases the evaluation when the unobserved outcome could have been a transition. One option is an inverse-probability-of-censoring-weighted Brier score. In outline, subjects with an observed target event before \(h\) contribute their event loss weighted by the inverse estimated probability of remaining uncensored to that event time; subjects known to be event-free at \(h\), including those with a recorded competing transition by \(h\), contribute their non-event loss weighted by the inverse probability of remaining uncensored to the relevant observation time. Subjects censored before \(h\) contribute no directly observed horizon outcome. The exact estimator and weights depend on the outcome definition and censoring scheme.

Such weighting requires a suitable censoring model, conditional independent censoring given the information used in that model, and positive probability of remaining uncensored over the relevant follow-up. If some kinds of patients are almost always censored before a transition could be observed, weights can become unstable and the validation estimate imprecise. State transitions should be ascertained consistently, and the censoring model should not silently treat a competing transition as censoring when it is a known non-case for the specified target.

Worked Example: A Weighted Horizon Score With One Censored Subject

Consider four hypothetical validation subjects with fixed predictions \(q=(0.20,0.40,0.60,0.80)\) for a direct transition by horizon \(h\). Subject 1 has the target transition before \(h\), subject 2 has a competing transition before \(h\), and subject 3 is observed without either transition through \(h\). Subject 4 is censored before \(h\), so the horizon outcome is unknown. Suppose the fitted censoring model gives estimated censor-survival probabilities of 0.90 at the first two observed transition times and 0.80 at \(h\). Use the corresponding inverse weights for the known outcomes.

The observed squared losses for subjects 1, 2, and 3 are \((1-0.20)^2=0.64\), \((0-0.40)^2=0.16\), and \((0-0.60)^2=0.36\). The weighted score, with the conventional division by all four subjects, is

$$ \widehat{\mathrm{BS}}_{\mathrm{IPCW}}(h) =\frac{1}{4}\left(\frac{0.64}{0.90}+\frac{0.16}{0.90}+\frac{0.36}{0.80}\right) =\frac{0.7111+0.1778+0.4500}{4} =0.3347. $$

Subject 4 is not assigned outcome 0; that person’s unobserved horizon outcome is handled through the weighting estimator. This calculation is illustrative, not a general prescription for every competing-risk or multi-state censoring pattern. The weights and which observed outcomes contribute must follow the estimator appropriate to the defined endpoint and censoring process.

Validation estimates are subject to sampling variation. Confidence intervals can be obtained with methods appropriate to the metric and design; resampling should preserve the independent sampling unit, such as resampling whole patients rather than individual transition records when patients contribute multiple records. If the external data come from a small number of centers, uncertainty from sampling centers may also matter, and a patient-only resampling scheme may not represent it. Report the number of subjects and the number of each relevant transition, as rare transitions can make transition-specific estimates unstable.

Worked Discrimination and Design Checks

Worked Example: A Transition-Specific AUC

In a hypothetical cohort with complete follow-up to the chosen horizon, two patients experience the target transition and have predictions \(0.70\) and \(0.40\). Two patients do not experience it by the horizon and have predictions \(0.60\) and \(0.20\). There are \(2\times2=4\) case-control pairs. The \(0.70\) case prediction exceeds both control predictions, giving 2 wins; the \(0.40\) case prediction exceeds \(0.20\) but not \(0.60\), giving 1 win. Therefore,

$$ \mathrm{AUC}(h)=\frac{3}{4}=0.75. $$

The estimate indicates that a randomly selected case-control pair is correctly ordered in 75% of comparisons, under the stated tie convention. It does not mean that predictions are accurate to within 25%, and it does not assess whether a prediction such as 0.70 corresponds to a 70% event frequency among comparable patients.

A practical external validation separates two questions. First, does the locked model produce predictions for the target population using available inputs and the intended prediction time? Second, how well do those predictions agree with outcomes there? Keeping this separation clear prevents outcome information from influencing the predictions that are then evaluated.

Temporal validation across calendar periods applies a model in a later period, whereas external validation applies it in a distinct population or setting; the distinction is determined by the validation design, not merely by the date of data collection. Internal validation addresses performance in the development setting under resampling or related procedures. Neither form substitutes for measuring performance in the intended external target population. Conversely, a single external cohort does not establish performance everywhere.

Common Pitfalls and Limits

  • Refitting before evaluation. Updating coefficients or baseline risks using validation outcomes changes the prediction procedure. Evaluate the frozen model first; any subsequent updating is a separate analysis.
  • Changing the estimand. Treating a direct transition as equivalent to occupying a state at the horizon can misclassify outcomes. Specify the target and match it to the model output.
  • Ignoring competing transitions. A competing transition may make the target event impossible as defined, but it is still an observed outcome. Do not automatically discard it as censoring.
  • Calling a favorable average “calibration.” Equal overall observed and predicted proportions can conceal overprediction in one range and underprediction in another.
  • Overinterpreting discrimination. AUC concerns ranking, not absolute probability accuracy, and can be uncertain when few transitions occur.
  • Assuming transportability from one validation. External performance pertains to the sampled target population, its follow-up, outcome ascertainment, and prediction horizons. It is not a guarantee for other settings.

External validation is an assessment, not a causal analysis. Differences in performance between populations do not by themselves show that population membership caused the difference. They may reflect sampling uncertainty, outcome measurement, follow-up, or differences in the populations and settings. This tutorial evaluates the fixed model; changing its baseline risks or coefficients is a distinct task.

Key takeaway: A useful external validation applies a reproducible, locked prediction process to a clearly defined distinct population; matches each prediction to its transition target, time origin, and horizon; handles competing transitions and censoring according to the endpoint; and reports transition-specific performance with appropriate uncertainty. Its conclusions are limited to the population and prediction setting actually evaluated.

Check Your Understanding

Answer each question using the stated target and assumptions. Brief solutions follow.

  1. A model predicts direct transition to state \(s\) within 14 days. A subject enters another competing state on day 5. For a direct-transition-by-day-14 outcome, is this subject a case, a non-case, or an outcome with unknown status?
  2. Four fully observed outcomes are \(Y=(1,0,0,1)\), and predictions are \(q=(0.8,0.3,0.4,0.6)\). Calculate the Brier score.
  3. Why does matching the average predicted probability to the observed event proportion not establish good calibration throughout the prediction range?
  4. In a validation cohort, a patient is censored before the horizon and has no observed transition. Why is coding the patient as a non-case generally inappropriate?
  5. What does an AUC of 0.75 say about transition-specific predictions, and what does it not say?

Solutions. (1) It is a non-case for the specified direct-transition endpoint: the competing first transition occurred before the target transition. (2) The squared losses are \(0.04, 0.09, 0.16,\) and \(0.16\), so the Brier score is \((0.04+0.09+0.16+0.16)/4=0.1125\). (3) Different prediction ranges can have opposing overprediction and underprediction that cancel in the overall averages; the equality gives only an aggregate comparison. (4) The unobserved outcome by the horizon could be a target transition, so assigning zero can bias performance estimates; use an appropriate censoring-aware method or restrict to a design with complete ascertainment. (5) Under the stated case, control, and tie definitions, a randomly chosen case has a higher prediction than a randomly chosen control in about 75% of pairs. It does not establish accurate probability values or calibration.

Clinical Biostats