Manuel B. Garcia

Manuel B. Garcia serves as the Senior Director for Educational Technology and Digital Learning at FEU Institute of Technology, Manila, Philippines. Read More

Contact Info

1607, FEU Tech Building,
P. Paredes St, Sampaloc,
Manila, Philippines
mbgarcia@feutech.edu.ph

Follow Me

How Large Should a Sample Be for Prediction Model Development?

Developing a reliable prediction model requires sufficient data to estimate its parameters and limit overfitting. Learn how outcome frequency, candidate predictors, anticipated performance, and modern sample-size criteria determine whether a development dataset is adequate.

696
Sample Size for Prediction Model Development Guide 696 of 1272
01 · The Question

How Much Data Do You Need to Develop a Prediction Model That Works Beyond Your Sample?

You want to develop a model that predicts which university students are likely to discontinue enrollment, which patients may experience complications, or which learners might require additional academic support.

Your dataset contains hundreds or perhaps thousands of observations. You have identified several candidate predictors, selected a modeling algorithm, and are ready to begin.

But is the dataset sufficiently large to develop a model that produces reliable predictions for new individuals? Does the answer depend on the number of predictors, the frequency of the outcome, or how accurately the model is expected to predict?

Prediction model development requires more than fitting a regression equation successfully. The available data must support the estimation of model parameters while limiting overfitting and uncertainty in predicted outcomes.

02 · The Short Answer

Sample Size Depends on Model Complexity, Outcome Information, and Expected Performance

In Brief

There is no universal minimum sample size for prediction model development. The required sample depends on the outcome type and frequency, number of candidate predictor parameters, anticipated predictive performance, and the degree of overfitting and estimation uncertainty considered acceptable.

For conventional multivariable prediction models, modern approaches such as those developed by Riley and colleagues provide more defensible planning criteria than fixed rules requiring a particular number of observations or events per predictor. Complex machine-learning procedures may require simulation or other model-specific assessments because conventional regression formulas do not necessarily capture their effective complexity.

03 · What You Need to Know

Determining the Sample Size Needed to Develop a Reliable Prediction Model

What Is Prediction Model Development?

Prediction model development involves using observed data to estimate a mathematical relationship between predictors and an outcome so that predictions can be generated for individuals whose outcomes are not yet known.

For example, a university might develop a model that estimates the probability of student dropout from prior academic performance, attendance, enrollment characteristics, and engagement measures.

The intended output is an individual prediction, such as a probability of dropout, rather than necessarily a causal explanation of why dropout occurs.

This distinction matters because a predictor can improve prediction without being a causal determinant of the outcome. Conversely, a scientifically important explanatory variable may contribute little additional predictive information after other variables are included.

The primary sample-size objective is therefore to support a model that performs adequately when applied beyond the development observations.

Why Is Sample Size Important for Prediction Models?

Prediction models estimate relationships from a finite dataset. When the amount of information is limited relative to model complexity, the fitted model may capture random patterns specific to the development sample.

This phenomenon is known as overfitting.

An overfitted model may perform impressively when evaluated using the same data on which it was developed, but less favorably when applied to new individuals.

Possible consequences include unstable predictor coefficients, excessively extreme predicted probabilities, poor calibration, and optimistic estimates of predictive performance.

Increasing sample size generally provides more information, but the amount needed depends on the prediction task and modeling procedure.

What Determines the Required Development Sample?

Several factors influence the information required for prediction model development.

Planning factor Why it matters
Outcome type Continuous, binary, count, and time-to-event outcomes require different estimation and planning methods.
Outcome frequency Rare binary events may provide limited information even when total sample size is large.
Candidate predictor parameters Additional coefficients and model flexibility increase complexity.
Anticipated model performance The expected strength of predictive relationships affects overfitting and sample-size criteria.
Acceptable shrinkage A stricter requirement for limiting coefficient overfitting may increase the required sample.
Predictor distributions Rare categories, restricted variation, and correlated predictors can reduce usable information.
Modeling procedure Variable selection, nonlinear functions, interactions, and tuning can increase effective complexity.

These factors should be evaluated jointly. A large sample does not necessarily compensate for extremely rare outcomes or poorly represented predictor categories.

Why Is the Number of Candidate Predictor Parameters Important?

Every candidate parameter introduces flexibility into a model. Greater flexibility may improve the representation of genuine relationships, but it also increases the opportunity to fit sampling noise.

Importantly, a predictor variable does not always correspond to one parameter.

A categorical predictor with five levels may require four coefficients. A continuous predictor represented using nonlinear spline terms may require several coefficients. Interactions introduce further parameters.

For example, a model with eight named predictors could contain fifteen or more predictor parameters depending on their specification.

The number of candidate predictor parameters should therefore be established before calculating the required sample.

For data-driven predictor selection, the original candidate set matters because the selection process itself can contribute to overfitting.

Why Does Outcome Frequency Matter for Binary Prediction?

Binary prediction models estimate the probability of an event, such as dropout or treatment failure.

When the outcome is uncommon, relatively few observations may contain the event of interest.

For example, a dataset containing 2,000 students with a dropout prevalence of 2% would contain approximately 40 dropout events on average.

That may provide limited information for a complex prediction model, particularly if the candidate predictors include rare categories or interactions.

The number of outcome events needed for logistic regression cannot be determined using a universal minimum.

Both events and nonevents contribute information, and their distribution across predictor values is consequential.

Is Ten Events per Variable Sufficient for Prediction Model Development?

The traditional ten-events-per-variable rule is a historical heuristic rather than a universally valid sample-size requirement.

It does not directly account for anticipated model performance, the acceptable degree of overfitting, or the precision of estimated outcome risk.

Van Smeden and colleagues (2019) investigated the limitations of events-per-variable criteria for binary logistic prediction models.

Their work supports moving beyond fixed event-to-parameter ratios toward criteria that more directly address prediction model performance.

Consequently, the ten events per variable rule should not be the sole justification for a development sample.

What Is the Riley Sample-Size Approach?

Riley and colleagues (2019) proposed minimum sample-size criteria for developing multivariable prediction models with continuous, binary, and time-to-event outcomes.

Their approach considers multiple criteria rather than selecting a sample solely from a fixed number of observations or events per predictor.

For binary-outcome prediction models, important criteria include limiting overfitting through a target global shrinkage factor, restricting optimism in model fit, and estimating the overall outcome risk with sufficient precision.

The final recommended sample is generally the largest requirement arising from the applicable criteria.

These calculations require assumptions about anticipated model performance and candidate predictor complexity. They are not free of uncertainty simply because the resulting formula is more sophisticated.

What Is a Global Shrinkage Factor?

Shrinkage describes the reduction of estimated regression coefficients toward zero to address overfitting.

In conventional prediction modeling, a global shrinkage factor below one indicates that the fitted coefficients may need to be reduced to improve their expected performance in new data.

A target shrinkage factor of at least 0.90 is commonly used in the sample-size framework proposed by Riley and colleagues, although the appropriate criterion depends on the planning objective.

A factor of 0.90 should not be interpreted as 90% predictive accuracy.

Rather, it is a criterion related to the anticipated extent of coefficient overfitting.

How Can Shrinkage Be Used in a Sample-Size Calculation?

For a conventional maximum-likelihood logistic prediction model, one approximation used in shrinkage-based planning relates sample size to the number of candidate predictor parameters and anticipated Cox-Snell R-squared.

Illustrative Shrinkage-Based Sample-Size Criterion
n ≈ P / [(S − 1) ln(1 − R2 CS/S)]

n = approximate required development sample; P = number of candidate predictor parameters excluding the intercept; S = target global shrinkage factor between zero and one; R2 CS = anticipated Cox-Snell R-squared for the model; ln = natural logarithm. The anticipated R-squared must be feasible for the specified outcome distribution.

Suppose P = 10, S = 0.90, and anticipated Cox-Snell R-squared is 0.15.

n ≈ 10 / [(−0.10) × ln(1 − 0.15/0.90)].

Since ln(0.8333) ≈ −0.1823, n ≈ 548.5, giving approximately 549 observations under this criterion.

This is only the shrinkage-based component of planning. Other criteria, including optimism and precision of overall outcome risk, may require a larger sample.

The expression should not be applied indiscriminately to machine-learning algorithms, penalized procedures, or other outcome types. Its assumptions and interpretation belong to the specified conventional prediction-model framework.

Why Is Anticipated R-Squared Needed?

Anticipated model performance provides information about how much of the outcome variation the candidate predictors are expected to explain.

For binary outcomes, Cox-Snell R-squared is one measure of overall model fit that can inform sample-size calculations.

Its possible maximum depends on the outcome distribution, so it is not interchangeable with every other pseudo-R-squared measure.

Researchers may obtain plausible performance estimates from previous prediction studies, systematic reviews, or comparable datasets.

However, apparent performance from a small development study can be optimistic. Borrowed estimates should be evaluated for transportability to the proposed population.

If anticipated performance is uncertain, several plausible values should be examined through sensitivity analysis.

Why Does Estimating Overall Outcome Risk Matter?

A prediction model generally includes an intercept or baseline component that influences the overall level of predicted outcomes.

For binary prediction, the overall event proportion provides information relevant to this component.

If the event rate is estimated imprecisely, the model's overall predicted risk may also be uncertain.

One planning criterion therefore concerns the precision with which the overall outcome risk can be estimated.

For a simple independent binary-outcome setting, an approximate calculation is:

Approximate Precision of Overall Event Risk
n ≈ Z2π(1 − π)/E2

π = anticipated event proportion; E = desired absolute confidence-interval half-width; Z = normal critical value; n = required independent observations for this precision criterion.

If the anticipated event proportion is 0.10, the desired absolute half-width is 0.025, and the confidence level is 95%:

n ≈ 1.962 × 0.10 × 0.90 / 0.0252 ≈ 553.19.

Rounding upward gives approximately 554 observations under the conventional normal approximation.

This calculation concerns overall event-risk precision. It does not independently establish adequate information for all prediction-model coefficients.

Why Must Several Sample-Size Criteria Be Considered?

A development sample might satisfy one criterion while failing another.

For example, a sample may be large enough to estimate overall event prevalence reasonably precisely but too small to limit coefficient overfitting.

Conversely, a relatively simple model with strong anticipated performance may satisfy a shrinkage criterion while still producing an imprecise estimate of a rare outcome's overall frequency.

Modern planning therefore considers multiple requirements and identifies the most demanding applicable criterion.

The numerical result should then be evaluated against the assumptions supporting each calculation.

How Does Sample-Size Planning Differ for Continuous Outcomes?

Continuous-outcome prediction models estimate numerical quantities such as examination scores, blood pressure, or completion time.

Unlike binary-outcome models, they do not have a natural count of outcome events.

The relevant information depends on residual variation, anticipated explained variance, candidate parameter complexity, and the precision of important model quantities.

Riley and colleagues (2019) provide criteria for continuous-outcome prediction models that consider overfitting and estimation precision.

A fixed number of observations per predictor is not a substitute for these calculations.

What About Time-to-Event Prediction Models?

Time-to-event models predict whether or when an event occurs, accounting for follow-up time and censoring.

Examples include predicting time until student withdrawal, disease recurrence, or equipment failure.

Sample-size planning must consider the number of observed events, the duration of follow-up, censoring, candidate parameters, and anticipated model performance.

Two studies with the same total sample size can provide different information when their event frequencies and follow-up patterns differ.

Methods developed specifically for time-to-event prediction should therefore be used.

Can Machine-Learning Models Use the Same Sample-Size Formulas?

Not necessarily. Random forests, gradient boosting, neural networks, and other machine-learning methods can have effective complexity that is not adequately described by a conventional regression coefficient count.

The required sample may depend on the algorithm, tuning strategy, predictor dimensionality, signal strength, class imbalance, and intended performance measure.

For these methods, simulation or learning-curve analysis may help evaluate how model performance changes with sample size.

However, learning curves estimated from an existing small dataset cannot reliably establish performance at arbitrarily larger sample sizes without additional assumptions.

Researchers should avoid assuming that an algorithm capable of fitting high-dimensional data can necessarily generalize from a small development sample.

Does Regularization Reduce the Required Sample Size?

Regularization methods such as ridge regression, lasso, and elastic net can reduce some consequences of overfitting.

They may improve predictive performance when model complexity is substantial relative to the available information.

However, regularization does not guarantee adequate calibration or reliable performance in new populations.

Hyperparameter tuning also uses information from the development data and should be incorporated into validation.

Sample-size planning should reflect the complete modeling procedure rather than assume that penalization eliminates information requirements.

Should the Development Sample Be Split Into Training and Testing Sets?

Randomly splitting a limited development dataset into separate training and testing subsets is not automatically the most efficient approach.

A split reduces the number of observations available for fitting the model, while the test subset may be too small to estimate performance precisely.

Bootstrap validation and appropriate cross-validation can often make more efficient use of limited development data for internal validation.

These procedures should include all relevant model-development steps, including variable selection and hyperparameter tuning, to avoid information leakage.

Internal validation does not replace external validation using an independent dataset.

How Should Missing Data Affect Sample-Size Planning?

Missing predictor and outcome information can reduce the effective information available for development.

Complete-case analysis may discard substantial portions of the sample and can introduce bias when missingness is systematic.

Appropriate imputation methods may retain information under specified assumptions, but they cannot fully recover information absent from the data.

Researchers should anticipate missingness, specify a defensible analysis strategy, and consider its implications for the required recruitment sample.

The development and validation procedures must handle missing data consistently with the intended real-world use of the model.

What If the Available Sample Is Smaller Than Recommended?

A sample-size recommendation may exceed the available data, particularly when outcomes are rare or candidate models are complex.

Researchers can consider collecting additional observations, combining compatible datasets, simplifying the candidate model, or using appropriate penalized methods.

However, reducing predictors should be scientifically justified. Removing potentially useful information solely to meet a numerical rule may undermine the intended model.

If the available sample remains inadequate for the intended objective, the analysis may need to be framed as exploratory or developmental, with explicit limitations concerning uncertainty and generalizability.

Reporting the achieved sample and model performance transparently is preferable to presenting an inadequately supported model as ready for deployment.

How Should Uncertainty in Planning Assumptions Be Addressed?

Sample-size requirements can be sensitive to anticipated outcome prevalence, model performance, candidate parameter count, and acceptable shrinkage.

Researchers should avoid selecting optimistic assumptions merely because they produce a feasible sample.

A sample-size sensitivity analysis can show how requirements change under plausible alternatives.

Where several inputs are uncertain, using evidence-informed ranges provides a more transparent basis for planning than relying on a single unsupported estimate.

04 · A Practical Example

Planning the Development Sample for a Student Dropout Prediction Model

Hypothetical Example

Developing a Logistic Prediction Model for Academic Withdrawal

A university research team wants to develop a logistic regression model predicting student withdrawal within one academic year.

The anticipated withdrawal rate is 10%. The candidate model contains ten predictor parameters, and the team provisionally assumes Cox-Snell R-squared of 0.15 based on comparable evidence.

The team considers a target global shrinkage factor of 0.90 and an absolute precision target of ±2.5 percentage points for estimating overall withdrawal prevalence.

Illustrative planning criterion Approximate completed sample Interpretation
Global shrinkage factor of 0.90 549 Limits anticipated coefficient overfitting under the specified approximation.
Overall event-risk precision of ±2.5 percentage points 554 Targets approximate precision of the overall event proportion.
Additional optimism criterion Requires separate calculation May increase the final sample-size requirement.
Step 1: Define the prediction objective

The outcome is withdrawal within one academic year, and the model will estimate individual withdrawal probabilities.

Step 2: Establish candidate complexity

The team counts ten candidate predictor parameters, including all categorical contrasts and planned transformations.

Step 3: Calculate the shrinkage criterion

Using the stated assumptions produces an approximate requirement of 549 observations.

Step 4: Calculate the event-risk precision criterion

The approximate requirement is 554 observations for a 95% interval targeting a half-width of 2.5 percentage points around 10% prevalence.

Step 5: Complete the remaining criteria

The team evaluates optimism in model fit and checks whether the anticipated R-squared is plausible. The final requirement is not established until all applicable criteria have been evaluated.

Step 6: Translate the completed sample into recruitment

The team considers missing outcomes, predictor completeness, and expected withdrawal frequency before selecting the final recruitment target.

The example demonstrates why a modern prediction-model sample-size calculation cannot be reduced to one events-per-variable ratio. Different criteria may produce different requirements, and the most demanding applicable criterion governs the final recommendation.

The numerical results are illustrative planning calculations, not evidence that a development sample of 554 students would necessarily be sufficient for the proposed model.

05 · What Researchers Often Get Wrong

Common Misconceptions About Prediction Model Development Sample Size

Misconception

Ten Events per Predictor Guarantees a Reliable Prediction Model

Fixed EPV thresholds do not adequately address anticipated model performance, overfitting, shrinkage, or precision of overall outcome risk.

Misconception

A Dataset With Thousands of Rows Must Be Sufficient

Rare outcomes, extensive candidate predictors, and complex modeling procedures may produce insufficient information even in large datasets.

Misconception

High Training Accuracy Means the Development Sample Was Adequate

Apparent performance can be optimistic because the model was evaluated using data that influenced its development. Appropriate validation is required.

Misconception

Randomly Splitting the Dataset Automatically Prevents Overfitting

Data splitting does not eliminate overfitting and can reduce information available for development. Internal validation must evaluate the complete modeling process.

Misconception

Regularization Makes Sample-Size Planning Unnecessary

Regularization can improve some aspects of model stability but cannot guarantee adequate calibration, discrimination, or generalizability from limited data.

Misconception

A Calculated Minimum Sample Guarantees External Validity

Sample-size criteria address specified statistical requirements. Transportability also depends on population differences, measurement practices, temporal changes, and independent validation.

06 · What This Means for You

Calculate Development Sample Size Before Fitting the Prediction Model

Start by defining the prediction outcome, intended population, and modeling approach. Identify the complete candidate predictor specification and establish credible assumptions about outcome frequency and anticipated predictive performance.

Then use a sample-size method appropriate to the outcome and modeling procedure.

A simple decision framework

If developing a conventional binary logistic prediction model
Consider modern criteria for shrinkage, optimism, overall outcome-risk precision, and candidate parameter complexity.
If predicting a continuous outcome
Use criteria appropriate to continuous-outcome prediction, including residual variation and anticipated explained variance.
If developing a time-to-event model
Account for observed events, censoring, follow-up, and anticipated model performance.
If using a complex machine-learning algorithm
Consider simulation and learning-curve evidence that reflect the complete training and tuning procedure.
If the available sample is below the calculated requirement
Reconsider recruitment, model complexity, or the scope of the intended conclusions and disclose remaining limitations.

The final protocol should document the outcome definition, candidate parameter count, anticipated performance assumptions, sample-size criteria, and internal validation strategy.

Prediction model development should also be distinguished from external validation. Developing a model and evaluating its performance independently are separate objectives with different information requirements.

07 · A Quick Checklist

Before Finalizing Sample Size for Prediction Model Development

Before accepting the development sample-size justification, check:
Define the prediction outcome, target population, and intended application.
Identify whether the outcome is continuous, binary, count, or time-to-event.
Count all candidate predictor parameters and planned nonlinear or interaction terms.
Obtain defensible assumptions about outcome prevalence and anticipated model performance.
Use sample-size criteria appropriate to the model rather than relying solely on EPV.
Evaluate shrinkage, overfitting, and precision requirements where applicable.
Plan internal validation that includes predictor selection and model tuning.
Account for missing data, sparse predictor categories, and outcome imbalance.
Examine sensitivity to plausible alternative planning assumptions.
Document the calculation method, resulting requirement, and limitations of the planned model.
08 · Frequently Asked Questions

Frequently Asked Questions About Prediction Model Development Sample Size

What is the minimum sample size for developing a prediction model?

There is no universal minimum. Requirements depend on the outcome, candidate parameter complexity, anticipated performance, and acceptable overfitting or estimation uncertainty.

Is ten events per variable enough for prediction modeling?

Not necessarily. The traditional rule does not account adequately for important model-development criteria. Modern prediction-model sample-size methods are preferable when their assumptions apply.

What is the Riley sample-size method?

It is a framework for determining minimum sample size in conventional multivariable prediction model development using criteria related to overfitting, anticipated performance, and estimation precision.

Does a prediction model with more predictors need more data?

Additional candidate parameters generally increase complexity and information requirements, although the exact relationship depends on expected performance, predictor distributions, and the modeling procedure.

Can I develop a model with fewer observations than predictors?

Some specialized regularized or high-dimensional methods permit this computationally, but reliable performance requires appropriate structural assumptions, validation, and adequate outcome information.

Should I reserve 20% of the data for testing?

Not automatically. A random split can reduce development information and produce imprecise test estimates. Bootstrap or cross-validation procedures may be more efficient for internal validation, particularly with limited data.

Does the development sample-size calculation guarantee good prediction?

No. It addresses specified planning criteria under assumptions. Actual predictive performance depends on data quality, model specification, population characteristics, and validation results.

Can the same sample-size formula be used for neural networks?

Not automatically. Neural networks and other machine-learning algorithms may require model-specific simulation or empirical learning-curve assessments because their effective complexity differs from conventional regression models.

09 · The Bottom Line

Plan for Reliable Predictions, Not Merely a Model That Can Be Fitted

The Bottom Line

Prediction model development sample size should reflect outcome information, candidate model complexity, anticipated performance, and acceptable overfitting. A fixed observations-per-predictor or events-per-variable rule is not a sufficient general justification.

Use modern sample-size criteria when applicable, examine uncertain assumptions, and plan appropriate internal validation. The objective is to develop a model with credible potential to perform beyond the observations used to fit it.

10 · Sources and Further Reading

Research Literature on Prediction Model Development Sample Size

11 · Cite this Guide

How to Cite This Guide

This guide is intended to be read, shared, and used in research, teaching, and academic work. If you draw on its ideas, explanations, or other content, please acknowledge the source by citing the guide. Doing so gives appropriate credit and helps your readers locate the original resource.

Has the Field Guide helped your research?

If a guide helped clarify a question, inform a research decision, or move your work forward, I would love to hear about your experience. Your story may also help other researchers discover the Field Guide.

Share Your Experience
Takes only a few minutes