  When developing a clinical prediction model, the sample size of the
development dataset is a key consideration. Small sample sizes lead to greater
concerns of overfitting, instability, poor performance and lack of fairness.
Previous research has outlined minimum sample size calculations to minimise
overfitting and precisely estimate the overall risk. However even when meeting
these criteria, the uncertainty (instability) in individual-level risk
estimates may be considerable. In this article we propose how to examine and
calculate the sample size required for developing a model with acceptably
precise individual-level risk estimates to inform decisions and improve
fairness. We outline a five-step process to be used before data collection or
when an existing dataset is available. It requires researchers to specify the
overall risk in the target population, the (anticipated) distribution of key
predictors in the model, and an assumed 'core model' either specified directly
(i.e., a logistic regression equation is provided) or based on specified
C-statistic and relative effects of (standardised) predictors. We produce
closed-form solutions that decompose the variance of an individual's risk
estimate into Fisher's unit information matrix, predictor values and total
sample size; this allows researchers to quickly calculate and examine
individual-level uncertainty interval widths and classification instability for
specified sample sizes. Such information can be presented to key stakeholders
(e.g., health professionals, patients, funders) using prediction and
classification instability plots to help identify the (target) sample size
required to improve trust, reliability and fairness in individual predictions.
Our proposal is implemented in software module pmstabilityss. We provide real
examples and emphasise the importance of clinical context including any risk
thresholds for decision making.
