Statistical Calculators › Correlation and Regression › Logistic Regression Sample Size (Continuous Predictor)
← All Calculators

Correlation and Regression

Logistic Regression Sample Size (Continuous Predictor)

Estimate the total sample size required to detect a specified odds ratio for a binary outcome when the predictor is continuous and approximately normally distributed. The calculation follows the Hsieh, Bloch & Larsen sample-size approximation, with an optional adjustment for correlation between the predictor of interest and other covariates.

Study Parameters

Enter the anticipated event probability at the mean of the continuous predictor and the odds ratio associated with a one-standard-deviation increase in the predictor.
For a normal continuous predictor, P₀ is the probability that Y = 1 when X is at its mean.
OR compares the odds at X = mean + 1 SD with the odds at X = mean.
Use 0 when there are no additional covariates. Higher R² increases the required sample size.

Sample Size Result

Hsieh's normal-approximation formula for a continuous normally distributed predictor.
Enter study parameters and click Calculate Sample Size.

Methodology

This calculator implements the sample-size approximation described by Hsieh, Bloch, and Larsen (1998) for simple logistic regression with a continuous predictor. The binary outcome is modeled with a logistic regression, and the effect of interest is the regression coefficient for the continuous predictor.

For a normally distributed predictor, the odds ratio entered here is interpreted as the odds ratio comparing the probability of Y = 1 at the mean of X with the probability at one standard deviation above the mean. Thus, if β is the logistic-regression coefficient, the entered odds ratio satisfies OR = exp(βσX).

Sample-size formula

N₀ = [z1−α* + zpower]2 / [P₀(1 − P₀){ln(OR)}2]

N = N₀ / (1 − R²)

Here, α* = α/2 for a two-sided test and α* = α for a one-sided test. P₀ is the event probability at the mean of X, OR is the odds ratio for a one-standard-deviation increase in X, and R² is the squared multiple correlation between the predictor of interest and the remaining covariates.

The final result is rounded up to the next whole participant because the sample size must be an integer. The R² adjustment follows the PASS documentation: the simple-regression sample size is divided by 1 − R² to account for the loss of information caused by correlation between the predictor of interest and other covariates.

Derived alternative probability

P₁ = OR × P₀ / [1 − P₀ + OR × P₀]

P₁ is the event probability when X is one standard deviation above its mean. It is implied by P₀ and the specified odds ratio and is displayed by the calculator as a useful interpretation of the assumed effect.

Validation example

PASS's published validation example based on Hsieh (1998, p. 1628) uses a continuous predictor, N = 317, α = 0.05, a two-sided test, P₀ = 0.50, and OR = 1.50. PASS reports power = 0.95049. The calculator reproduces N = 317 and approximately 95.05% power for those inputs.

Validation target: P₀ = 0.50 · OR = 1.50 · α = 0.05 · power = 0.95 · two-sided · R² = 0
Calculated N = 317
Implied power at N = 317 = 0.95049

Important interpretation

The continuous predictor is assumed to be approximately normally distributed for the interpretation of the one-standard-deviation effect. The calculation is an analytical approximation rather than a simulation of the full logistic-regression likelihood. As with the source method, the anticipated event probability, effect size, and predictor/covariate relationship should be based on appropriate prior evidence or study-planning assumptions.

References

Hsieh, F. Y., Bloch, D. A., & Larsen, M. D. (1998). A simple method of sample size calculation for linear and logistic regression. Statistics in Medicine, 17(14), 1623–1634. DOI: 10.1002/(SICI)1097-0258(19980730)17:14<1623::AID-SIM871>3.0.CO;2-S.

Hintze, J. L. (2008). PASS User's Guide III: Standard Deviations, Variances, Normality Tests, Survival Analysis, Correlations, Regression, Design of Experiments, and Tools, Helps, and Aids. NCSS, Kaysville, Utah. Chapter 860, Logistic Regression.

NCSS. Sample Size for Regression in PASS. PASS documentation describes the logistic-regression procedure as testing a coefficient equal to zero versus a specified alternative and documents the continuous/normal covariate formulation.