The events per variable calculator tells you whether your data can support a regression model: the events per variable, the maximum number of predictors and the sample needed for the model you want.
How the calculation works
- Enter the sample size and the number of events of the rarer outcome.
- Enter the number of candidate predictor parameters and choose the target.
- The calculator gives the events per variable, the maximum predictors, the events and sample needed and the shortfall.
Example
A study has 300 patients and 60 events, and you want to test 8 candidate predictors. The events per variable are 60 / 8 = 7.50, below the usual rule of 10. At 10 events per variable, the data support 6 predictors. For 8 predictors you need 80 events, which is 400 patients at the same event rate of 20.0 %.
Why it matters
The calculator helps medical researchers who build prediction models, students of epidemiology and data scientists who work with imbalanced outcomes.
Good to know
The rule is about overfitting: with too few events, the model fits noise, and its performance in new patients is worse than in the data used to build it. Techniques such as penalized regression and shrinkage help but do not remove the problem. Reduce the number of candidates using knowledge of the subject rather than the data, for example by combining related variables or by dropping those with little evidence. For a continuous predictor modeled with a spline, count each term. For a linear regression with a continuous outcome, the guideline is milder, at about 10 to 20 observations per predictor. Report the number of events and of candidate parameters in your methods.
Related tools
The logistic regression calculator gives probabilities from coefficients, the linear regression calculator fits lines, the sample size calculator sizes surveys and the R-squared calculator measures fit.