Extended sample size calculations for evaluation of prediction models using a threshold for classification

When evaluating the performance of a model for individualised risk prediction, the sample size needs to be large enough to precisely estimate the performance measures of interest. Current sample size guidance is based on precisely estimating calibration, discrimination, and net benefit, which should be the first stage of calculating the minimum required sample size. However, when a clinically important threshold is used for classification, other performance measures are also often reported. We extend the previously published guidance to precisely estimate threshold-based performance measures. We have reported closed-form solutions to estimate the sample size required to target sufficiently precise estimates of accuracy, specificity, sensitivity, positive predictive value (PPV), negative predictive value (NPV), and an iterative method to estimate the sample size required to target a sufficiently precise estimate of the F1-score, in an external evaluation study of a prediction model with a binary outcome. This approach requires the user to pre-specify the target standard error and the expected value for each performance measure alongside the outcome prevalence. We describe how the sample size formulae were derived and demonstrate their use in an example. Extension to time-to-event outcomes is also considered. In our examples, the minimum sample size required was lower than that required to precisely estimate the calibration slope, and we expect this would most often be the case. Our formulae, along with corresponding Python code and updated R, Stata and Python commands (pmvalsampsize), enable researchers to calculate the minimum sample size needed to precisely estimate threshold-based performance measures in an external evaluation study. These criteria should be used alongside previously published criteria to precisely estimate the calibration, discrimination, and net-benefit.

Authors

Institutions

Publication Details

Journal
BMC Medical Research Methodology
Published
2025-07-01
DOI
https://doi.org/10.1186/s12874-025-02592-4
Citations
4
Primary Topic
Health Systems, Economic Evaluations, Quality of Life
Type
article
Field-Weighted Citation Impact
12.52

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Extended sample size calculations for evaluation of prediction models using a threshold for classification

Joseph Edward Alderman, Joie Ensor, Rebecca Whittle, Richard D Riley et al.
4 citations
BMC Medical Research Methodology
Health Systems, Economic Evaluations, Quality of Life
12.52
article

Extended sample size calculations for evaluation of prediction models using a threshold for classification

Joseph Edward Alderman, Joie Ensor, Rebecca Whittle, Richard D Riley, Kym I E Snell, Paula Dhiman, Professor Gary S. Collins, Maarten van Smeden, Alastair Keith Denniston, Amardeep Legha, Jean‐Baptiste Cazier, Lucinda Archer, Karel G. M. Moons
article en
4 citations

Abstract

When evaluating the performance of a model for individualised risk prediction, the sample size needs to be large enough to precisely estimate the performance measures of interest. Current sample size guidance is based on precisely estimating calibration, discrimination, and net benefit, which should be the first stage of calculating the minimum required sample size. However, when a clinically important threshold is used for classification, other performance measures are also often reported. We extend the previously published guidance to precisely estimate threshold-based performance measures. We have reported closed-form solutions to estimate the sample size required to target sufficiently precise estimates of accuracy, specificity, sensitivity, positive predictive value (PPV), negative predictive value (NPV), and an iterative method to estimate the sample size required to target a sufficiently precise estimate of the F1-score, in an external evaluation study of a prediction model with a binary outcome. This approach requires the user to pre-specify the target standard error and the expected value for each performance measure alongside the outcome prevalence. We describe how the sample size formulae were derived and demonstrate their use in an example. Extension to time-to-event outcomes is also considered. In our examples, the minimum sample size required was lower than that required to precisely estimate the calibration slope, and we expect this would most often be the case. Our formulae, along with corresponding Python code and updated R, Stata and Python commands (pmvalsampsize), enable researchers to calculate the minimum sample size needed to precisely estimate threshold-based performance measures in an external evaluation study. These criteria should be used alongside previously published criteria to precisely estimate the calibration, discrimination, and net-benefit.

BMC Medical Research MethodologyVol. 25(1)
Utrecht University (NL), The Francis Crick Institute (GB), Nuffield Orthopaedic Centre (GB), University Medical Center Utrecht (NL), University of Oxford (GB), NIHR Birmingham Biomedical Research Centre (GB), University of Birmingham (GB)
University Hospitals Birmingham NHS Foundation Trust, Cancer Research UK, National Institute for Health and Care Research, Department of Health and Social Care, Engineering and Physical Sciences Research Council, Birmingham Biomedical Research Centre
Reduced inequalities, Peace, Justice and strong institutions
Openalex Percentile: Top 2%
Health Systems, Economic Evaluations, Quality of Life
12.52
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.