Logistic Regression Sample Size Calculator

This logistic regression sample size calculator plans your study three ways: the events-per-variable rule, a binary predictor, or a continuous predictor with an odds ratio.

10 is a common rule of thumb, not a guarantee.

Checks on your data

  • Events per variable is at least 10.
  • The EPV rule is about the number of events, not the total sample. A rare outcome needs a large sample to produce enough events.
  • The power formulas assume a single predictor of interest. Models with many correlated predictors may need more.

Results

Total sample size
250
events per variable rule
Events needed (outcome cases)
50
Less common outcome rate used
20%
Show step-by-step solution
  1. Events needed = predictors × events per variable = 5 × 10 = 50.
  2. Sample size = events ÷ rate of the less common outcome = 50 ÷ 0.2 = 250, rounded up to 250.
EPV rulen = (predictors × EPV) / event rate
Continuous predictorn = (zα/2 + zβ)² / [P(1−P)β*²]
DropoutDivide by (1 − dropout)

What Is Logistic Regression Sample Size?

In logistic regression the information in your data comes from the outcome events, not the total number of subjects. A common rule of thumb asks for at least 10 events per predictor variable, and the total sample is the events needed divided by the rate of the less common outcome.

For a power-based answer, enter the odds ratio you want to detect with your alpha and power. The calculator uses the standard two-proportion formula for a binary predictor and the Hsieh, Bloch and Larsen formula for a continuous predictor, with a correction when the predictor is correlated with others and an allowance for dropout.

These are planning figures. The 10 events per variable rule is a guideline rather than a law, so justify your choice in a study plan and consider specialised software for complex models.

How to Use the Logistic Regression Sample Size Calculator

  1. Pick a method.
  2. Enter predictors and event rate, or the odds ratio, alpha and power.
  3. Add an allowance for dropout and read the total.

Logistic Regression Sample Size Formula

Events per variable

n=k×EPVmin⁡(p,1−p)n=\frac{k\times EPV}{\min(p,1-p)}

Hsieh (continuous predictor)

n=(z1−α/2+z1−β)2P(1−P) β∗2n=\frac{(z_{1-\alpha/2}+z_{1-\beta})^2}{P(1-P)\,\beta^{*2}}

Correction for other predictors

nadj=n1−R2n_{adj}=\frac{n}{1-R^2}

Logistic Regression Sample Size Variables Explained

SymbolMeaningNotes
EPVEvents per variable10 is a common minimum
OROdds ratio to detect
α and powerSignificance level and powere.g. 0.05 and 80%
PEvent rate at the mean of the predictor
R²Correlation of the predictor with other predictorsInflates n by 1/(1 − R²)

Logistic Regression Sample Size Worked Example

With the example values loaded in the calculator above, the steps are:

  1. Events needed = predictors × events per variable = 5 × 10 = 50.
  2. Sample size = events ÷ rate of the less common outcome = 50 ÷ 0.2 = 250, rounded up to 250.

Result: Total sample size = 250; Events needed (outcome cases) = 50.

Worked example: events per variable

A model with 5 predictors at 10 events per variable needs 50 events. If 20% of subjects have the outcome, the sample size is 50 ÷ 0.20 = 250.

Power calculation for a continuous predictor

To detect an odds ratio of 2 per 1 SD with 20% event rate at the mean, α = 0.05 and 80% power: β* = ln 2 = 0.6931, and n = (1.96 + 0.8416)² ÷ (0.2 × 0.8 × 0.4805) = 7.849 ÷ 0.07688 = 102.1, which rounds up to 103.

This follows the formula by Hsieh, Bloch and Larsen for a normally distributed predictor. It is an approximation for small effects.

Limits of the rule of thumb

The 10 events per variable rule is a guideline from simulation work, not a law. Some studies need more, particularly with rare predictors or when the model will be used for prediction. Treat the result as a minimum and justify your choice in your study plan.

Where Logistic Regression Sample Size Is Used

Study protocols

Justify the sample size for a prediction or risk model.

Grant applications

Show a power-based sample size for a target odds ratio.

Checking feasibility

See how many events you need given the outcome rate.

Common Logistic Regression Sample Size Mistakes to Avoid

  • Count predictor parameters, not variables: a categorical variable with 4 levels uses 3 parameters.
  • Plan for dropout and missing data on top of the calculated size.

Logistic Regression Sample Size Terms and Definitions

Events per variable (EPV)
The number of outcome events divided by the number of predictor parameters in the model.
Odds ratio
The multiplicative change in the odds of the outcome for a one-unit change in the predictor.

Logistic Regression Sample Size FAQs

How many events per variable do I need in logistic regression?

A common minimum is 10 events per variable, though some work suggests more for stable estimates.

Is the sample size based on events or total subjects?

Events. Divide the events needed by the event rate to get the total sample.

How do I choose the odds ratio to detect?

Use the smallest effect that would matter in practice, not the effect you hope to see.

Does this work for several predictors?

The power formulas target one predictor of interest. Use the EPV rule, or specialised software, for many predictors.

What does R² with other predictors do?

If the predictor of interest is correlated with others, you need more subjects. The sample size is divided by (1 − R²).

How do I allow for dropout?

Divide the sample size by 1 minus the expected dropout proportion.

Related calculators

Last updated 2026-11-09. See our disclaimer.