How to Read a Calibration Plot: A 5-Step Guide for Clinical Prediction Models

Clinical Epidemiology ResearchMethodology and Research DesignPrognosis [Methodology]
How to Read a Calibration Plot: A 5-Step Guide for Clinical Prediction Models
On this page

อ่านฉบับภาษาไทย (Thai version)

Abstract

A calibration plot answers one question. When a model gives a risk, does that share of patients really have the event? This guide reads one plot in five steps. It uses a synthetic validation set of 10,000 patients scored by six models. In the opening case, 701 patients were told a risk near 0.40, and 0.59 of them had the event. Step 1 asks whether the points sit above or below the 45 degree line. Step 2 asks whether the gap runs across the whole risk range or only part of it. Step 3 reads the shape, a flat, steep or shifted curve, together with the calibration slope and intercept. Step 4 checks how the plot was drawn, as grouped points or as a smooth curve. Step 5 reads calibration beside discrimination. All six of our models share an AUC of 0.876, yet only one is well calibrated. A five item checklist closes the guide.


Visual summary · ภาพสรุป

One case first: a predicted risk of 0.40 that turned out to be 0.59

Imagine a validation study of 10,000 patients. The data are synthetic, made up for teaching, and every number below comes from one simulation. Six models scored the same patients. We follow one of them first.

That model told 701 patients that their risk of the event was between 0.35 and 0.45. On average it told them 0.40. When the outcomes came in, 0.59 of those 701 patients had the event.

So the model said about four in ten, and about six in ten happened. The model was too low for this group. A calibration plot is the picture that shows this kind of gap for every group at once.

Calibration means agreement between predicted risk and observed risk [1]. Predicted risk is what the model says. Observed risk is the share of patients who really had the event. In our case the two were 0.40 and 0.59.

The one idea: predicted risk against observed risk

A calibration plot puts the two risks on two axes. The x axis is predicted risk, what the model said. The y axis is observed risk, what really happened. Both axes run from 0% to 100%.

The dashed diagonal is the 45 degree line. On it, observed risk equals predicted risk. A perfectly calibrated model keeps every point on this line.

Our opening group would sit at 0.40 across and 0.59 up. That point lies above the line, because 0.59 is more than 0.40.

Two observed group means sit on opposite sides of the agreement line.
Figure 1. Look at the dashed 45 degree line first: it marks perfect agreement. The two points are grouped means from another model, not our 701 patients. The left point sits above the line, so that group's risk was set too low. The right point sits below it, so that group's risk was set too high. Synthetic data.

Step 1. Position: above or below the line

Start with the simplest question. Where do the points sit relative to the line?

A point above the line means more events happened than the model predicted. The model underestimates risk there. Our opening group is the example: predicted 0.40, observed 0.59.

A point below the line means fewer events happened than predicted. The model overestimates risk there. Patients in such a group hear a risk that is worse than their real one.

One number sums up position for the whole set. Divide the events that happened by the events the model expected. This ratio is called O/E, the observed to expected ratio, and 1 is a perfect match.

O/E covers all 10,000 patients, not only the 701. The model from our opening case expected about 3,266 events, and 4,386 happened. Its O/E is 4,386 / 3,266 = 1.343, so overall it saw more events than it predicted. The model that overestimates everywhere had 0.787.

One ratio cannot show where the gap sits. The next step reads the plot from left to right.

Step 2. Pattern: off everywhere, or only in part of the range

Next, follow the points from left to right. Is the gap the same size and direction everywhere?

In the top two panels of Figure 2, the curve stays on one side of the line almost everywhere. That is miscalibration everywhere. One model is too high for nearly every patient, and the other is too low.

In the bottom two panels, the curve crosses the line in the middle of the risk range. It is close to the line there and bends away at both ends. That is partial miscalibration, and its typical look is an S shape.

Partial miscalibration matters because a clinical decision usually sits in one part of the range. A model can be fine for low risk patients and wrong for high risk ones. Read the region where your decision sits.

Step 3 shows that these two S shapes share one cause, a calibration slope away from 1.

Four curves show downward and upward shifts and slopes below and above one.
Figure 2. Compare the top panels with the bottom panels. On top, each curve stays on one side of the dashed line. So the model is off across the whole range. Below, each curve crosses the line in the middle and bends away at the ends. That is the S shape of partial miscalibration. Synthetic data. Solid curves are the true risks from the simulation.

Step 3. Shape: flat, steep or shifted

Now read the shape of the curve, and then two numbers that go with it. The shape tells you which kind of error the model makes.

A flat curve means the predictions are too extreme. Low predictions are too low and high ones too high. Real risks spread less than the model claims. This is the bottom left panel of Figure 2.

The usual cause is overfitting. The model learned quirks of the patients it was built on, so its predictions spread too wide on new patients.

A steep curve means the predictions are too modest. They huddle near the middle while the real risks spread wider. This is the bottom right panel.

A shift means the whole curve sits above or below the line. On the log odds scale, the gap is the same size everywhere. That is the top two panels: the model is too high, or too low, for everyone.

To put flatness into one number, refit the outcome on the model's predicted log odds. The coefficient you get is called the calibration slope [2, 3]. It is 1 when the spread is right. Below 1 means too extreme, and above 1 means too modest.

The too extreme model had a slope of 0.578 and the too modest one 1.775. The well calibrated model had 1.012.

To put the shift into one number, refit with the slope fixed at 1. The intercept you get is called calibration-in-the-large, often just the calibration intercept [2, 3]. It measures the average shift, and 0 is ideal.

The underestimating model from our opening case had 0.816, a shift upward. The overestimating model had -0.824, a shift downward. The well calibrated model had -0.004.

Read the numbers with the plot, never instead of it. A slope near 1 can still hide a bend in the curve. One intercept cannot show where in the range the gap sits.

In short, calibration-in-the-large compares the average predicted risk with the average observed risk. Its full story, with worked numbers, is in Calibration in the Large & the Calibration Intercept.

The slope recap is as short. It falls below 1 when a model is overfitted, and shrinkage pulls it back. Its home is The Calibration Slope: Overfitting, Extremeness & Shrinkage. When either number is off, Recalibration in Practice: Intercept, Slope & Honest Validation shows how to repair the model.

Six models scored on the same 10,000 synthetic patients. Read each row with its curve. The slope tells flat or steep, and the intercept tells the shift. All six share an AUC of 0.876.
ModelCalibration-in-the-largeCalibration slopeAUCO/E
Well calibrated-0.0041.0120.8760.999
Overestimates-0.8241.0120.8760.787
Underestimates (opening case)0.8161.0120.8761.343
Too extreme0.0960.5780.8761.021
Too modest-0.0801.7750.8760.966
High AUC, miscalibrated-1.4470.8160.8760.711

Step 4. How the plot was drawn: grouped points or a smooth curve

Before you trust a shape, check how the plot was made. The same patients can be drawn in two ways.

A grouped plot sorts patients by predicted risk and cuts them into ten equal groups, called deciles. Each point is one group, with its mean predicted risk across and its observed risk up. The left panel of Figure 3 has ten such points.

A smooth curve draws a line through every patient's outcome instead of through group means. LOESS does it by averaging the outcomes of nearby patients at each predicted risk [4]. A spline does it by joining a few gentle curved pieces. The right panel uses a natural spline, one kind of spline, on the same data.

Each has a weakness. Ten points depend on where the groups are cut, and each group mixes patients with different risks. A smooth curve shows the whole range, but it wobbles where data are thin.

Few patients or events at either end make any plot unreliable there. Check the confidence band at the ends when one is drawn.

In Figure 3 both panels tell the same story. Low predictions are too low, high predictions are too high, and the curve is flat. It is the too extreme model again, not the model from our opening case.

The two ways of drawing the plot are compared in Risk Score Calibration Plot vs Decile Calibration Plot (pmcalplot). Why the bands around them differ, Wald against Wilson and GLM against LOESS, is in Why Calibration Confidence Intervals Differ: Wald vs Wilson and Parametric GLM vs LOESS.

Ten decile means and a smooth curve show the same broad calibration pattern.
Figure 3. Compare the ten decile points on the left with the smooth curve on the right. Both come from the same predictions and outcomes. Both sit above the dashed line at low risk and below it at high risk. That is the flat shape of predictions that are too extreme. Synthetic data.

Step 5. Read it beside discrimination

Discrimination asks a different question. Does the model rank patients who have the event above those who do not? The AUC measures it. Calibration asks whether the risk numbers themselves are right.

The two can disagree. All six of our models rank the patients in the same order. So all six have an AUC of 0.876, while their calibration ranges from nearly perfect to badly wrong.

Figure 4 shows two of them. The left model follows the line. The right model sits below it across most of the range.

The right model's calibration intercept is -1.447 and its O/E is 0.711. It predicts far more events than happen, yet its AUC is the same 0.876.

So a high AUC tells you the order is good. It does not tell you that a patient told 0.40 has a risk near 0.40. Our opening model shows it too: it ranks as well as the others, yet its 0.40 group had 0.59. Why the AUC alone cannot judge a model is the theme of Why ROC/AUROC Is Not Enough: A Strategic Guide to Evaluating Clinical Prediction Models [ROC/AUROC → Calibration → Stability].

Two models have the same AUC. Only one curve follows the agreement line.
Figure 4. Compare the two orange curves with the dashed line. Both models have an AUC of 0.876, yet only the left one follows the line. The right one sits below it, so it gives most patients too high a risk. Synthetic data. Solid curves are the true risks from the simulation.

Do not judge by the Hosmer-Lemeshow test alone

Many papers report a Hosmer-Lemeshow test instead of a plot. The test sorts patients into groups, often deciles. It then gives one p-value for the gap between observed and expected events [5].

It cannot show where the model is wrong or in which direction. Its verdict also swings with sample size and with the number of groups [5]. So use it, if at all, beside the plot, never in its place. The test and its limits are explained in our post on the Hosmer-Lemeshow test and calibration plots.

The quick reading checklist

  1. Position. Are the points above the line, where the model underestimates, or below it, where the model overestimates?
  2. Pattern. Does the gap run across the whole range, or only part of it, as in an S shape?
  3. Shape. Is the curve flat (slope below 1, too extreme) or steep (slope above 1, too modest)? Is it shifted (intercept away from 0)? Read the numbers with the plot.
  4. Drawing. Is it decile points or a smooth curve? How many patients and events sit behind each end?
  5. Discrimination. What is the AUC, and does good ranking come with good calibration? Never let a Hosmer-Lemeshow p-value stand in for the plot.

Run the five checks in this order. The first three read the curve. The fourth asks whether the curve can be trusted. The fifth sets it beside the rest of the model's performance.

References

  1. Van Calster B, McLernon DJ, van Smeden M, Wynants L, Steyerberg EW. Calibration: the Achilles heel of predictive analytics. BMC Medicine. 2019;17:230. https://doi.org/10.1186/s12916-019-1466-7
  2. Van Calster B, Nieboer D, Vergouwe Y, De Cock B, Pencina MJ, Steyerberg EW. A calibration hierarchy for risk models was defined: from utopia to empirical data. Journal of Clinical Epidemiology. 2016;74:167-176. https://doi.org/10.1016/j.jclinepi.2015.12.005
  3. Riley RD, Archer L, Snell KIE, Ensor J, Dhiman P, Martin GP, et al. Evaluation of clinical prediction models (part 2): how to undertake an external validation study. BMJ. 2024;384:e074820. https://doi.org/10.1136/bmj-2023-074820
  4. Austin PC, Steyerberg EW. Graphical assessment of internal and external calibration of logistic regression models by using loess smoothers. Statistics in Medicine. 2014;33(3):517-535. https://doi.org/10.1002/sim.5941
  5. Kramer AA, Zimmerman JE. Assessing the calibration of mortality benchmarks in critical care: the Hosmer-Lemeshow test revisited. Critical Care Medicine. 2007;35(9):2052-2056. https://doi.org/10.1097/01.CCM.0000275267.64078.B0

Key takeaways

  • A calibration plot puts predicted risk across and observed risk up, and the 45 degree line is perfect agreement.
  • Points above the line mean the model underestimates: 701 patients told 0.40 had 0.59. Points below mean it overestimates.
  • Flat curve (slope below 1): too extreme. Steep curve (slope above 1): too modest. Shifted curve: the intercept moves.
  • Check how the plot was drawn, decile points or a smooth curve, before you trust its shape.
  • An AUC of 0.876 belongs to a calibrated model and a badly miscalibrated one alike. Read calibration beside discrimination.

Related in the wiki: Calibration in the Large & the Calibration Intercept · The Calibration Slope: Overfitting, Extremeness & Shrinkage · Recalibration in Practice: Intercept, Slope & Honest Validation · Risk Score Calibration Plot vs Decile Calibration Plot (pmcalplot) · Why Calibration Confidence Intervals Differ: Wald vs Wilson and Parametric GLM vs LOESS · Why ROC/AUROC Is Not Enough: A Strategic Guide to Evaluating Clinical Prediction Models [ROC/AUROC → Calibration → Stability]

0
Message for International and Thai ReadersUnderstanding My Medical Context in ThailandRead more →Message for International and Thai ReadersUnderstanding My Broader Content Beyond MedicineRead more →

Comments

No comments yet. Be the first to share your thoughts.

Sign in to comment