Tutorials › Competing Risks and Multi-State Models › Comparing Two Models On The Same Subjects

Transition-Specific Prediction Validation · Tutorial 413 of 699

Comparing Two Models On The Same Subjects

Estimate paired differences in transition-specific validation metrics and use subject-level resampling to assess how uncertain those comparisons are.

Advanced 10 min read

What You'll Learn

  • Define a signed difference so its direction has a clear interpretation for scores and losses.
  • Explain why comparing models on the same subjects calls for paired rather than independent-sample uncertainty.
  • Apply a subject-level bootstrap while keeping each subject’s predictions and outcome history together.
  • Recompute censoring-adjusted and non-additive metrics within each bootstrap resample.
  • Recognize when rare transitions, unstable weights, or too few subjects make comparison intervals unreliable.

Why the Comparison Must Preserve Pairing

When two prediction models are evaluated on the same validation subjects, each subject contributes information to both models’ metrics. The comparison is therefore paired: the subjects, outcome histories, follow-up, and often censoring patterns are shared. Treating the two metric estimates as if they came from independent validation samples discards that pairing and can misstate uncertainty.

A useful comparison starts by fixing the validation target: the transition of interest, prediction horizon or integration range, metric definition, and any weighting scheme. Both models must be evaluated against that same target. For example, a transition-specific Brier score is a loss, for which smaller values are better; an AUC is a discrimination measure, for which larger values are better.

Definition: Let \(M_A\) and \(M_B\) be the values of the same transition-specific validation metric for models A and B, evaluated on the same validation sample. Define the signed difference as \(\Delta=M_A-M_B\). For a higher-is-better metric, a positive \(\Delta\) favors model A; for a lower-is-better metric, a negative \(\Delta\) favors model A. State the metric’s direction whenever interpreting \(\Delta\).

The target is usually the difference in performance in a population represented by the validation sample, estimated by the observed paired difference. A confidence interval describes uncertainty in that difference under the sampling and metric-estimation assumptions; it does not give the probability that one model is better.

Assumptions and a Paired-Variance Justification

For a simple additive metric, let \(L_{Ai}\) and \(L_{Bi}\) denote the subject-level contributions for subject \(i\), and set \(D_i=L_{Ai}-L_{Bi}\). Then the paired estimate is \(\bar{D}=n^{-1}\sum_{i=1}^n D_i\). This representation applies directly to an ordinary mean loss. For a censoring-adjusted or normalized metric, the metric may instead be a ratio or weighted average; in that case, the whole metric should be recomputed from the resampled data rather than assuming that a fixed subject-level contribution fully represents it.

The usual paired standard error for an additive mean difference is \(s_D/\sqrt{n}\), where \(s_D\) is the sample standard deviation of the \(D_i\). The benefit of pairing is visible by expanding the variance:

$$ \operatorname{Var}(L_A-L_B) = \operatorname{Var}(L_A)+\operatorname{Var}(L_B) -2\operatorname{Cov}(L_A,L_B). $$

If the two models’ subject-level losses tend to move together, the covariance is positive, so the variance of their difference is smaller than it would be if that covariance were ignored. It is not guaranteed to be positive: pairing is the correct design, but it does not guarantee a narrower interval.

A paired standard-error calculation requires independent sampling units across subjects and an appropriate large-sample approximation for the mean difference. A subject bootstrap makes similar sampling-unit assumptions, while avoiding a normal approximation to the difference in some settings. If a subject contributes multiple records, transitions, or horizons, those records are not independent units: resample the subject and keep the records together.

For right-censored outcomes, a metric such as an inverse-probability-of-censoring-weighted (IPCW) score also relies on suitable censoring assumptions and adequate censoring-weight support. Those requirements apply to each model comparison, not just to the bootstrap. If censoring weights are estimated from the data, their estimation should generally be repeated within each bootstrap sample so that uncertainty from the weight estimation is reflected.

Worked Example: A Paired Difference in Brier Score

Suppose six hypothetical subjects have complete outcome ascertainment by a fixed horizon for a specified transition. Their Brier scores are:

SubjectModel AModel B\(D_i=\text{Brier}_A-\text{Brier}_B\)
10.120.15-0.03
20.200.180.02
30.080.10-0.02
40.300.220.08
50.160.140.02
60.240.200.04

The complete ascertainment means this illustration does not require censoring adjustment. The same subjects, transition, horizon, and Brier-score definition are used for both models. The mean scores and their difference are

$$ \bar{M}_A=\frac{1.10}{6}=0.1833,\qquad \bar{M}_B=\frac{0.99}{6}=0.1650,\qquad \bar{D}=\frac{-0.03+0.02-0.02+0.08+0.02+0.04}{6}=0.01833. $$

Because Brier score is a loss, the positive difference means model A’s mean loss is 0.01833 higher than model B’s in this sample. It does not, by itself, establish a population difference. For illustration, the sample standard deviation of the six paired differences is

$$ s_D= \sqrt{\frac{\sum_{i=1}^{6}(D_i-\bar{D})^2}{5}} = \sqrt{\frac{0.008083}{5}} =0.04021. $$

The paired standard error is \(0.04021/\sqrt{6}=0.01642\). This small-sample calculation is only an approximate summary of uncertainty: a normal-based interval would additionally require the distribution of the differences to be adequately represented by that approximation. In a validation analysis, subject-level resampling is a useful alternative, especially when the metric itself is not a simple mean of fixed contributions.

Subject-Level Bootstrap for the Difference

In the paired subject bootstrap, draw \(n\) subjects with replacement from the \(n\) validation subjects. Use the same resampled subject indices for both models. Recalculate both metrics on that resample and save their difference. Repeating this process \(B\) times gives a bootstrap distribution of differences. Its standard deviation estimates the bootstrap standard error; percentile quantiles can be used for a percentile confidence interval.

1
Define the comparison.
Fix the transition, horizon or integration range, metric, weighting, and sign convention. Confirm that both models are being compared on the same validation target.
2
Resample subjects.
Draw subject identifiers with replacement. Carry each selected subject’s full relevant outcome and censoring history, and both models’ predictions, into the resample.
3
Recalculate both metrics.
Within the resample, recompute any estimated censoring weights and the full metric for each model. For AUC, recalculate the case-control comparisons; do not treat the original AUC as a fixed per-subject score.
4
Summarize differences.
Save \(\Delta^{*(b)}=M_A^{*(b)}-M_B^{*(b)}\) for each resample \(b\). Use the bootstrap distribution to report an uncertainty measure on the same metric scale as the difference.

For a percentile interval with confidence level \(1-\alpha\), take the \(\alpha/2\) and \(1-\alpha/2\) quantiles of the bootstrap differences. The interval describes sampling uncertainty under the subject-resampling scheme and the assumptions of the validation design. A bootstrap interval does not fix biased predictions, an inappropriate metric, or violations of the censoring assumptions.

Worked Example: Calculating Bootstrap Differences

For a transparent calculation, consider four hypothetical subjects with paired differences in a lower-is-better transition-specific loss of \(-0.02,\ 0.00,\ 0.04,\ 0.06\), where each difference is model A minus model B. The observed difference is

$$ \bar{D}=\frac{-0.02+0.00+0.04+0.06}{4}=0.020. $$

A positive value means model A has the higher, and therefore worse, loss in this sample. Consider these six illustrative subject bootstrap draws, shown by their sampled subject numbers: (1, 2, 3, 4), (1, 1, 2, 3), (2, 2, 3, 4), (1, 3, 4, 4), (1, 2, 2, 4), and (2, 3, 3, 4). Their paired differences are calculated as follows:

$$ \begin{aligned} \Delta^{*(1)}&=(-0.02+0.00+0.04+0.06)/4=0.020,\\ \Delta^{*(2)}&=(-0.02-0.02+0.00+0.04)/4=0.000,\\ \Delta^{*(3)}&=(0.00+0.00+0.04+0.06)/4=0.025,\\ \Delta^{*(4)}&=(-0.02+0.04+0.06+0.06)/4=0.035,\\ \Delta^{*(5)}&=(-0.02+0.00+0.00+0.06)/4=0.010,\\ \Delta^{*(6)}&=(0.00+0.04+0.04+0.06)/4=0.035. \end{aligned} $$

The mean of these six bootstrap differences is 0.02083, and their sample standard deviation is approximately 0.01393. These six draws demonstrate the arithmetic only; they are far too few to provide a reliable bootstrap standard error or confidence interval. In practice, use many resamples, check whether the resulting distribution is stable to increasing \(B\), and report the actual number of resamples and interval method.

Multiple Transitions and Non-Additive Metrics

A comparison may involve several transitions or horizons. If the goal is a separate difference for each transition, calculate and report each one with its own uncertainty. If the goal is a prespecified aggregate, define how transition-specific metrics are combined before looking at the results. Use the same subject resample for all components: this preserves dependence between the metrics and permits an uncertainty assessment for their aggregate.

For a non-additive metric such as AUC, the bootstrap still resamples subjects, but the metric must be rebuilt from the resampled cases and controls. A subject may appear more than once in a bootstrap sample; those repeated copies are part of the resampling calculation, not new independent people in the original cohort. If a resample contains too few cases or controls to define the metric, record and investigate that failure rather than silently replacing it with a convenient value.

Worked Example: Preserving Dependence Across Two Transitions

Suppose four hypothetical subjects have differences in lower-is-better Brier score for transitions 1 and 2, again defined as model A minus model B:

SubjectTransition 1 differenceTransition 2 difference
1-0.020.03
20.040.01
30.000.05
40.02-0.01

The observed mean differences are \(( -0.02+0.04+0.00+0.02)/4=0.010\) for transition 1 and \((0.03+0.01+0.05-0.01)/4=0.020\) for transition 2. Suppose the prespecified aggregate is the equal-weight average of those two transition differences. Its observed value is \((0.010+0.020)/2=0.015\).

Now resample subjects 1, 1, 3, and 4. For transition 1 the bootstrap difference is \((-0.02-0.02+0.00+0.02)/4=-0.005\); for transition 2 it is \((0.03+0.03+0.05-0.01)/4=0.025\). The aggregate in this same resample is \((-0.005+0.025)/2=0.010\). Using one common draw preserves the fact that each subject’s two transition-specific records belong together. Drawing different subjects separately for each transition would instead create a bootstrap sample that does not represent the joint validation data and could misstate uncertainty in the aggregate.

Diagnostics, Alternatives, and Limitations

A paired subject bootstrap is appropriate when subjects are the independent sampling units and the validation cohort represents the target population. Before relying on its interval, examine whether the metric can be computed consistently across resamples. Relevant warning signs include very few observed events for a transition, many resamples with no cases or controls, extreme or unstable censoring weights, and an interval that changes materially with the number of bootstrap draws. These symptoms often indicate limited information in the validation data, not a problem that can be solved by increasing the number of bootstrap replicates.

For an additive mean metric with a well-behaved distribution of paired differences, a paired standard-error or paired \(t\)-interval is a simpler alternative. It uses the subject-level differences and their variability. The subject bootstrap is more flexible for metrics whose estimates involve weighting, normalization, or pairwise comparisons, but it is not automatically superior in a very small sample or with very rare transitions. Independent-sample comparison methods are generally not the right alternative when the models were evaluated on the same subjects: they omit the covariance induced by the shared data.

The uncertainty estimated here is uncertainty in comparing fixed model predictions on sampled validation subjects. It does not, by itself, account for model-fitting variability if the models were trained using those same subjects, and it does not correct over-optimism from model development. The interpretation also remains specific to the chosen transition, horizon, metric, and target population. A narrow interval for one metric is not evidence that all clinically relevant aspects of prediction are satisfactory.

Common mistake: Computing a confidence interval for each model separately and deciding the models differ because the intervals do not overlap, or do not differ because they do overlap. Those intervals do not directly estimate the paired difference. Instead, compute \(M_A-M_B\) on the same resampled subjects and form an interval for that difference. Interpret its sign using whether the metric is a score or a loss.

Check Your Understanding

Answer each question, then check the short solutions below.

  1. For a lower-is-better metric, what does a positive value of \(M_A-M_B\) indicate?
  2. Why must a bootstrap draw use the same subject identifiers for both models?
  3. In an IPCW comparison, why might censoring weights need to be re-estimated within each bootstrap sample?
  4. Why is it not enough to average fixed subject-level differences when the metric is AUC?
  5. Name two warning signs that a bootstrap interval for a rare-transition metric may be unreliable.

Solutions. (1) Model A has the larger loss in the observed comparison, so the difference favors model B. (2) Both models were evaluated on the same subjects; using the same draw preserves that pairing and its covariance. (3) The weights are estimated quantities, and re-estimation includes their sampling variability in the bootstrap distribution. (4) AUC is based on case-control comparisons, so it must be recomputed from the resampled cases and controls rather than treated as a simple mean of fixed individual contributions. (5) Examples include many resamples with too few cases or controls to calculate the metric, unstable censoring weights, and intervals that change substantially as the number of bootstrap draws increases.

Clinical Biostats