Why Examine Transition-Prediction Residuals?
A transition prediction is a probability for a specified destination, starting state, and time horizon. A residual summary compares those predictions with outcomes observed in a validation sample. Its central question is direct: on average, are predicted probabilities higher or lower than the observed transition probability? The answer can reveal systematic overprediction or underprediction, but it is not a complete assessment of a model.
Censoring complicates this comparison. If a person’s follow-up ends before the horizon, their state at that horizon may be unknown. Counting that person as having no transition, or simply omitting them without checking the censoring mechanism, can distort the observed outcome summary. This tutorial defines a fixed-horizon residual and shows how inverse-probability-of-censoring weighting can account for incomplete observation under explicit assumptions.
Define the Outcome Before the Residual
Consider a validation sample of \(n\) people who are in state \(h\) at a specified landmark. Let \(\tau\) be the horizon measured from that landmark. For person \(i\), let \(Y_i(\tau)\) equal 1 if that person is in destination state \(k\) at the horizon, and 0 otherwise. This definition concerns state occupancy at the horizon: a person may reach \(k\) through intermediate states, if the model’s prediction is defined that way.
Let \(\hat{p}_i(\tau)\) be the model’s predicted probability that person \(i\) will be in state \(k\) at the horizon, conditional on the information used to make the prediction. The corresponding sample mean prediction is \(\bar{p}(\tau)=n^{-1}\sum_{i=1}^n\hat{p}_i(\tau)\). If every horizon outcome is observed, the simplest residual summary is the observed proportion minus the mean predicted probability.
This is an average calibration diagnostic, not an individual-level error measure. A residual near zero says that the two averages are close; it does not show that predictions are accurate for every person, that they are well calibrated throughout the prediction range, or that the model discriminates well between people with different outcomes.
Worked Example: Residual With Complete Follow-Up
Suppose six hypothetical people enter in state \(h\), and their state at horizon \(\tau\) is observed for all six. Their predictions for occupying state \(k\) are 0.20, 0.30, 0.40, 0.50, 0.30, and 0.30. Two people are in state \(k\) at the horizon.
The mean predicted probability is $$ \bar{p}(\tau)=\frac{0.20+0.30+0.40+0.50+0.30+0.30}{6} =\frac{2.00}{6}=0.3333. $$ The observed proportion is \(2/6=0.3333\). Therefore, $$ \hat{R}(\tau)=\frac{2}{6}-0.3333=0.0000. $$
In this hypothetical sample, the observed and mean predicted probabilities agree to the displayed precision. This agreement does not establish that the model is correct: different individual predictions could offset one another, and the sample is small. Complete follow-up makes this arithmetic comparison available, but does not remove sampling uncertainty.
Accounting for Censoring at the Horizon
Let \(C_i\) denote person \(i\)’s censoring time after the landmark, and define \(\Delta_i(\tau)=I(C_i\geq\tau)\), where \(I(\cdot)\) is 1 when its condition holds and 0 otherwise. The horizon outcome \(Y_i(\tau)\) is observed when \(\Delta_i(\tau)=1\). If \(\Delta_i(\tau)=0\), the person’s state at \(\tau\) is unknown unless the event history itself determines it; the methods here use the general case in which it is unknown.
Write \(G_i(\tau)=P(C_i\geq\tau\mid Z_i)\), where \(Z_i\) is the observed information used to model censoring. A practical estimate is \(\hat{G}_i(\tau)\). A weighted estimate of the observed destination-state proportion is $$ \hat{O}_{w}(\tau)=\frac{1}{n}\sum_{i=1}^{n}\frac{\Delta_i(\tau)Y_i(\tau)}{\hat{G}_i(\tau)}. $$ For a person censored before the horizon, the numerator is zero; their unobserved outcome is not coded as a known zero. The residual summary is \(\hat{R}_{w}(\tau)=\hat{O}_{w}(\tau)-\bar{p}(\tau)\).
The weighting has a simple rationale. A person observed through \(\tau\) represents similar people who would have been censored earlier. If, conditional on \(Z_i\), being uncensored through \(\tau\) is independent of the horizon outcome, then the inverse of the probability of remaining uncensored corrects for the reduced observation probability. Small \(\hat{G}_i(\tau)\) values produce large weights, making results unstable and sensitive to a few observations.
Why the Weighting Works
The basic justification is an expectation calculation. For clarity, first suppose the true \(G_i(\tau)\) is known, and write \(Y_i=Y_i(\tau)\), \(\Delta_i=\Delta_i(\tau)\), and \(G_i=G_i(\tau)\). Conditional independent censoring gives \(E[\Delta_i\mid Y_i,Z_i]=G_i\). Consequently, $$ E\left[\frac{\Delta_iY_i}{G_i}\,\middle|\,Y_i,Z_i\right] =\frac{Y_i}{G_i}E[\Delta_i\mid Y_i,Z_i] =Y_i. $$ Taking expectations again gives \(E[\Delta_iY_i/G_i]=E[Y_i]\). Thus the weighted outcome contribution has the same expectation as the fully observed horizon outcome. Subtracting the average prediction targets the difference between the mean outcome probability and the mean prediction.
This argument requires positivity: if \(G_i(\tau)=0\) for a group, no one in that group can be observed through the horizon, so the outcome probability there cannot be recovered by weighting. It also assumes the censoring model describes the relevant observation probabilities. In practice, replacing \(G_i\) with an estimated value adds uncertainty and possible model error; the expectation calculation alone does not guarantee an unbiased finite-sample estimate.
Worked Example: Weighted Residual With Early Censoring
In a hypothetical validation sample of 10 people, eight are observed through the horizon and two are censored earlier. Among the eight observed people, three are in state \(k\). Suppose the estimated probability of remaining uncensored through the horizon is 0.80 for everyone, and the mean predicted probability across all 10 people is 0.30.
The weighted observed proportion is $$ \hat{O}_{w}(\tau)=\frac{1}{10}\left(\frac{3}{0.80}\right) =\frac{3.75}{10}=0.375. $$ The two censored people contribute zero to the weighted outcome sum, not because their outcomes are known to be zero, but because the observed-outcome indicator \(\Delta_i(\tau)\) is zero. The residual summary is $$ \hat{R}_{w}(\tau)=0.375-0.30=0.075. $$
The weighted observed proportion exceeds the mean prediction by 0.075, or 7.5 percentage points. This interpretation is conditional on the censoring assumptions and the adequacy of the estimated censoring probability. The unweighted observed proportion among the eight people, \(3/8=0.375\), happens to match the weighted value here because the censoring probability is common; that coincidence does not make complete-case comparisons generally reliable.
Heterogeneous Censoring and Diagnostics
Censoring probabilities often differ across people. A single censoring probability is then inadequate unless it correctly represents the observation process for everyone. Inverse-probability weighting can accommodate measured differences, but it cannot repair unmeasured dependence between censoring and the horizon outcome. Before interpreting the residual, inspect the estimated censoring probabilities, the resulting weights, and how many people remain observable at the horizon.
Worked Example: Different Censoring Probabilities
Consider six hypothetical people, each entering the sample in state \(h\). Three have estimated horizon observation probability 0.90 and three have probability 0.60. Among the first three, one observed person has \(Y_i(\tau)=1\); among the second three, one observed person has \(Y_i(\tau)=1\). Assume all other observed outcomes are zero and each person in a group has the stated censoring probability. The six predictions are 0.40, 0.50, 0.30, 0.35, 0.45, and 0.25.
The mean prediction is $$ \bar{p}(\tau)=\frac{2.25}{6}=0.3750. $$ The weighted observed proportion is $$ \hat{O}_{w}(\tau)=\frac{1}{6}\left(\frac{1}{0.90}+\frac{1}{0.60}\right) =\frac{1.1111+1.6667}{6}=0.4630. $$ Therefore, $$ \hat{R}_{w}(\tau)=0.4630-0.3750=0.0880. $$
The weighted observed proportion is 8.80 percentage points above the mean prediction. The larger weight, \(1/0.60=1.667\), gives the observed outcome from the second group more representation because fewer people in that group are expected to remain observed through the horizon. That adjustment is justified only if the stated censoring probabilities are adequate and censoring is conditionally independent of the outcome.
Interpreting Residuals and Choosing an Approach
The complete-outcome residual and the weighted residual answer the same broad question: whether the observed destination-state probability differs from the mean predicted probability at a specified horizon. Their difference is how they handle incomplete outcomes. If everyone’s horizon state is observed, use the direct observed proportion. If some outcomes are unknown because of censoring, weighting can use the observed outcomes under its assumptions. A complete-case comparison instead describes the people observed through the horizon and can be misleading if those people differ in outcome risk from those censored earlier.
Pseudo-observations, introduced in the earlier material on pseudo-observations for transition-probability calibration, provide another route to calibration summaries under censoring. They are constructed from an estimator of the transition probability and can be used in calibration analyses. The weighted residual here is a direct fixed-horizon observed-minus-predicted summary. These approaches are not interchangeable in every setting: their construction, modeling choices, and uncertainty calculations differ. State which estimator was used and which population and horizon it targets.
A near-zero average residual does not establish calibration at every prediction level. Overprediction for some people can offset underprediction for others. Nor does it establish discrimination, which concerns how well predictions distinguish people with different outcomes. The residual is most informative when reported with uncertainty, its horizon and transition definition, the number observed through the horizon, and a description of censoring adjustment. Inference should account for estimation of the censoring distribution; resampling subjects and re-estimating that distribution is one practical approach.
Limitations and Practical Checks
A weighted residual can be unstable when few people are observed through the horizon or when some estimated censoring probabilities are close to zero. Large weights can make the estimate depend heavily on a small number of outcomes. Report the range of weights and the number of observed horizon outcomes; investigate whether apparent discrepancies are driven by sparse data. Weight truncation may reduce variance but changes the estimator and can introduce bias, so it should not be applied silently or treated as a universal fix.
The diagnostic also depends on matching the prediction to the observed outcome. The starting state, landmark, destination, horizon, and conditioning information must agree. A prediction for being in state \(k\) by a horizon is not automatically comparable with an outcome defined as the first transition to \(k\); those are different targets. Finally, a residual estimates a population-level discrepancy with sampling error. Small samples, rare destinations, and uncertain censoring estimates can all make its sign and magnitude unstable.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- If the weighted observed proportion is 0.28 and the mean predicted probability is 0.34, calculate the residual and interpret its sign.
- Why is a person censored before the horizon not automatically assigned a horizon outcome of zero?
- State the censoring-independence and positivity conditions needed for inverse-probability weighting.
- Suppose the residual is zero. Name one conclusion that is supported and one that is not supported.
Solutions. (1) The residual is \(0.28-0.34=-0.06\): the weighted observed proportion is 6 percentage points below the mean prediction. (2) Censoring before the horizon leaves the person’s state at that horizon unknown in the general case; unknown is not the same as a known zero. (3) Conditional on the observed information used in the censoring model, censoring must be independent of the horizon outcome, and each relevant group must have a positive probability of remaining observed through the horizon. (4) Zero supports the conclusion that the observed and mean predicted probabilities agree in this sample to the precision reported. It does not show that predictions are accurate for every person or that the model is calibrated at every prediction level.