Tutorials › Bayesian Clinical Trials › Checking Outcome-Model Calibration in the Control Cohort

External and Real-World Controls · Tutorial 379 of 696

Checking Outcome-Model Calibration in the Control Cohort

Learn to assess control-outcome predictions in relevant groups, quantify discrepancies, and distinguish model miscalibration from problems that calibration checks cannot resolve.

Advanced 11 min read

What You'll Learn

  • Define calibration for predicted control-outcome risks.
  • Compare observed and expected event counts across risk groups and clinical subgroups.
  • Quantify calibration differences and observed-to-expected ratios.
  • Account for sampling and posterior uncertainty when interpreting discrepancies.
  • Recognize how in-sample assessment, weighting, and outcome ascertainment affect calibration checks.
  • Explain why good calibration alone does not establish a valid causal treatment contrast.

Why Calibration Matters

An adjusted treatment contrast may depend on predictions from a model for outcomes under control. For example, an outcome-regression analysis can use that model to predict what trial participants would have experienced under control. If the model systematically predicts too few events for patients at high risk, the adjusted contrast may be distorted even if the model distinguishes higher-risk from lower-risk patients well.

Calibration checks compare predicted control outcomes with outcomes actually observed in controls. The comparison should be made not only overall, but also across risk groups and clinically relevant subgroups. A reassuring overall average can conceal errors that cancel one another—for example, overprediction in one subgroup and underprediction in another.

Definition: Let \(Y_i\) be a binary outcome for individual \(i\), with \(Y_i=1\) indicating the event, and let \(A_i=0\) denote control. A control-outcome model predicts \(q_i=P(Y_i=1\mid A_i=0,X_i)\), where \(X_i\) denotes measured covariates. The predictions are calibrated in a target group if, among individuals with predicted risk \(q\), the event frequency is \(q\) in the population. In practice, calibration is assessed approximately by comparing observed and predicted outcomes in groups of individuals.

A calibration check requires comparable outcome definitions and follow-up: an event counted in the predictions must be the same event, over the same time horizon, as the event counted in the observed control data. The controls must also be relevant to the population for which the predictions will be used. If controls have been weighted to represent a target population, the observed outcomes and predictions must be summarized using the same target weights.

Where possible, assess predictions for control outcomes that were not used to fit the model, such as held-out observations or predictions generated by cross-validation. Checking predictions on the same observations used to fit a flexible model can make performance look better than it is for new individuals. This does not make a training-data comparison useless, but it makes it a limited diagnostic rather than an independent assessment.

Group-Level Comparisons

One practical approach is to divide controls into risk groups using their predicted control risks, then compare observed and expected event counts in each group. Group boundaries can be chosen to produce clinically interpretable ranges and adequate numbers of outcomes; equal-sized groups are convenient but not mandatory. For group \(g\), let \(n_g\) be the number of controls, \(O_g\) the number of observed events, and \(q_i\) the predicted risk for individual \(i\). The expected event count is the sum of the individual predicted risks.

$$ E_g=\sum_{i\in g}q_i,\qquad \widehat{r}_{\mathrm{obs},g}=\frac{O_g}{n_g},\qquad \widehat{r}_{\mathrm{pred},g}=\frac{E_g}{n_g} $$

The difference \(\widehat{r}_{\mathrm{obs},g}-\widehat{r}_{\mathrm{pred},g}\) is the observed-minus-predicted risk, in percentage points when multiplied by 100. The ratio \(O_g/E_g\), when \(E_g>0\), is the observed-to-expected ratio. A difference above zero or a ratio above one indicates more events were observed than predicted. Neither summary, by itself, explains why the discrepancy arose.

These comparisons are diagnostic summaries, not proof that a particular causal assumption holds. In particular, calibration of predicted outcomes among controls does not show that all confounders were measured, that treatment groups are exchangeable after adjustment, or that the treatment contrast is unbiased. It addresses one component: whether control-outcome predictions agree with observed control outcomes in the groups examined.

Worked Example: Detecting Increasing Underprediction Across Risk Groups

In a hypothetical held-out control cohort, 300 patients are divided into three risk groups of 100. The model's average predicted event risks are 0.10, 0.20, and 0.30. The observed event counts are 14, 25, and 37, respectively. Compare the predictions with the observations.

For each group, the expected count is the group size multiplied by its average predicted risk. In the lowest-risk group, \(E_1=100(0.10)=10\), so the observed-minus-predicted risk is \(14/100-10/100=0.040\), or 4 percentage points. The observed-to-expected ratio is \(14/10=1.40\).

In the middle group, \(E_2=100(0.20)=20\). The risk difference is \(25/100-20/100=0.050\), or 5 percentage points, and the observed-to-expected ratio is \(25/20=1.25\). In the highest-risk group, \(E_3=100(0.30)=30\). The difference is \(37/100-30/100=0.070\), or 7 percentage points, and the ratio is \(37/30=1.23\).

Across all three groups, the model predicts \(10+20+30=60\) events, compared with \(14+25+37=76\) observed events. Thus the overall observed rate is \(76/300=0.253\), compared with a predicted rate of \(60/300=0.200\). The progressively positive group differences suggest underprediction throughout these risk ranges, rather than a discrepancy confined to one group. The comparison is a warning for an adjusted analysis that relies on these predictions; its size and uncertainty should be considered before deciding how to proceed.

Why Grouping and Subgroups Both Matter

Risk-group checks ask whether predictions agree with outcomes across levels of predicted risk. Subgroup checks ask whether agreement holds for clinically important categories such as age band, disease stage, or baseline treatment history. These questions are different. A model can be calibrated across risk groups overall while consistently underpredicting for one subgroup and overpredicting for another.

A useful subgroup is chosen for clinical relevance or because there is a plausible reason the outcome model may behave differently there—not simply because many subgroups are available to search. Report subgroup sizes, observed events, and expected events alongside the comparison. Small groups can show large differences by chance, while groups with very few events provide little information about calibration.

Worked Example: How Overall Calibration Can Hide Subgroup Errors

A hypothetical held-out control cohort has 100 women and 100 men. Each patient has a predicted control-outcome risk of 0.20. There are 12 observed events among women and 28 among men. Assess the overall and subgroup comparisons.

For women, the expected count is \(100(0.20)=20\), while 12 events are observed. The observed risk is \(12/100=0.12\), giving an observed-minus-predicted difference of \(0.12-0.20=-0.08\), or 8 percentage points of overprediction. The observed-to-expected ratio is \(12/20=0.60\).

For men, the expected count is also 20, while 28 events are observed. The observed risk is \(28/100=0.28\), so the difference is \(0.28-0.20=0.08\), or 8 percentage points of underprediction. The ratio is \(28/20=1.40\).

Overall, 40 events were observed and 40 were predicted. The observed and predicted risks are both \(40/200=0.20\). The overall comparison appears exact, but the subgroup comparisons show substantial discrepancies in opposite directions. If subgroup composition differs between a control cohort and the population in which predictions are used, this kind of cancellation can matter for an adjusted treatment contrast. The data do not establish why the subgroup differences occurred; they identify a pattern that warrants investigation.

Uncertainty and a Short Justification

Observed counts vary even when predicted risks are correct. A difference between observed and expected counts is therefore not automatically evidence of model failure. A simple reference calculation shows why sample size and predicted risk both matter. Suppose, for the moment, that the risks \(q_i\) are fixed and correct, and that the binary outcomes are independent conditional on those risks. Then \(O_g=\sum_{i\in g}Y_i\), with \(E(Y_i)=q_i\) and \(\operatorname{Var}(Y_i)=q_i(1-q_i)\).

$$ E(O_g-E_g)=\sum_{i\in g}(E(Y_i)-q_i)=0 $$

The mean discrepancy is zero under the assumed model. Independence gives a variance for the discrepancy by adding the individual outcome variances; subtracting the fixed expected count does not change that variance.

$$ \operatorname{Var}(O_g-E_g) =\operatorname{Var}\left(\sum_{i\in g}Y_i\right) =\sum_{i\in g}q_i(1-q_i) $$

This calculation justifies treating a modest discrepancy as potentially compatible with random outcome variation, especially in a small group. It is not a complete uncertainty analysis when the risks have been estimated. In a Bayesian analysis, model parameters and thus \(q_i\) are uncertain; their posterior uncertainty should be included when assessing the expected counts. A practical approach is to calculate \(E_g\) for each posterior draw of the control-outcome model, then examine the resulting distribution of group-level predicted risks or counts alongside the observed count and its sampling variability. Avoid interpreting a single posterior mean prediction as if it were known without error.

Worked Example: Accounting Approximately for Posterior Uncertainty

In a hypothetical held-out subgroup of 80 controls, 20 events are observed. Across posterior draws, the subgroup's average predicted risk has posterior mean 0.15 and posterior standard deviation 0.025. Use a simple approximate comparison to assess the discrepancy, assuming the individual outcome variation is represented by a common risk of 0.15 and the uncertainty in the subgroup mean prediction is independent of held-out outcome sampling.

The observed rate is \(20/80=0.250\). The posterior mean expected count is \(80(0.15)=12\), so the observed-minus-predicted difference is \(20-12=8\) events, or \(0.250-0.150=0.100\), a 10-percentage-point difference.

Using the fixed-risk binomial variance as an approximation, the outcome-sampling variance for the count is \(80(0.15)(0.85)=10.2\). The posterior standard deviation of the expected count is \(80(0.025)=2.00\) events, corresponding to variance \(2.00^2=4.00\). Under the stated simplifying independence assumption, the approximate variance of the discrepancy is \(10.2+4.00=14.2\), with standard deviation \(\sqrt{14.2}=3.77\) events. The difference of 8 events is about \(8/3.77=2.12\) of these standard deviations.

This calculation flags the discrepancy for follow-up; it is not an exact posterior probability or a universal decision threshold. The approximation relies on a common-risk representation and an independence assumption. With appreciable variation among individual risks, important parameter dependence, or small expected counts, use the posterior draws and an uncertainty method appropriate to the model rather than relying on this summary.

Diagnostics, Alternatives, and Limitations

A calibration plot can complement the tables: plot observed event proportions against average predicted risks across groups, with a reference line where observed and predicted risks agree. Show uncertainty intervals for observed proportions and, when feasible, uncertainty in the predictions. A systematic departure from the reference line is more concerning than an isolated noisy group, but the plot can be misleading if groups are very small or selected after looking at many possible partitions.

Check the data and analysis before interpreting a discrepancy as a model defect. Verify the endpoint coding, follow-up window, missing-outcome handling, and covariate definitions across sources. Check whether risk groups and subgroups contain enough controls and events to support the comparisons. If controls are weighted, calculate observed and predicted summaries using the same weights and use uncertainty estimates that account for weighting; an ordinary binomial standard error generally does not account for unequal weights. Revisit covariate overlap as well: predictions in regions with few comparable controls may be unreliable even if summaries look acceptable in the observed cohort.

Calibration has a different purpose from several other diagnostics. Discrimination measures how well predictions rank individuals by risk, not whether the predicted probabilities match event frequencies. Covariate balance evaluates differences in covariate distributions after adjustment, not agreement between predicted and observed outcomes. Calibration is also distinct from outcome-model fit assessed by broader checks of model-generated data: here the focus is specifically on observed-versus-predicted control outcomes in risk groups and clinically meaningful subgroups.

A calibration failure may signal a misspecified functional form, omitted interactions, population differences, or outcome measurement problems. This check alone cannot distinguish among them. Conversely, apparently good calibration cannot establish conditional exchangeability, rule out unmeasured confounding, or validate extrapolation to a population poorly represented by controls. In external-control analyses, calibration is most informative when assessed in controls relevant to the target population and interpreted together with the earlier material on overlap and covariate balance.

Common mistake: “The overall observed event rate equals the overall predicted rate, so the model is calibrated and the adjusted contrast is reliable.” The conclusion does not follow. Opposing subgroup errors can cancel in the overall average, and calibration does not establish the causal assumptions needed for an unbiased treatment contrast. Compare outcomes across risk groups and clinically relevant subgroups, and treat calibration as one diagnostic rather than a guarantee.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. A group of 50 controls has 10 observed events and a total predicted count of 8. Calculate the observed and predicted risks, the observed-minus-predicted difference, and the observed-to-expected ratio.
  2. Two equally sized clinical subgroups have predicted risks of 0.15 in both groups. One subgroup has a 0.10 observed event rate and the other a 0.20 rate. What is the overall observed rate, and why should the subgroup comparisons still be reported?
  3. Why can a calibration comparison on the same observations used to fit a flexible outcome model be overly reassuring?
  4. A weighted control analysis compares a weighted observed event rate with an unweighted predicted rate. What is the problem?

Solutions. (1) The observed risk is \(10/50=0.20\), and the predicted risk is \(8/50=0.16\). The difference is \(0.20-0.16=0.040\), or 4 percentage points; the observed-to-expected ratio is \(10/8=1.25\). (2) With equal subgroup sizes, the overall observed rate is \((0.10+0.20)/2=0.15\), matching the predicted rate. The subgroup results reveal underprediction in one group and overprediction in the other, which the overall average hides. (3) The model has already used those outcomes during fitting, so its predictions can reflect the same data being used to assess it; held-out or cross-validated predictions provide a less optimistic diagnostic. (4) The summaries refer to different populations or weighting schemes, so their difference does not provide a like-for-like calibration comparison. Apply consistent target weights to both summaries and use uncertainty estimates appropriate to the weights.

Clinical Biostats