Correlation and Regression
Estimate the sample size needed to detect an association between a binary predictor and a binary outcome in a logistic regression model. Enter the baseline event probability, odds ratio, predictor prevalence, alpha, and desired power. The calculation uses the Hsieh, Bloch & Larsen approximation for a single binary covariate.
This calculator treats a logistic regression with one binary predictor as the comparison of two outcome probabilities: P0 when X=0 and P1 when X=1. The odds ratio specifies the relationship between those probabilities:
For a binary predictor, Hsieh, Bloch, and Larsen (1998) show that the logistic-regression sample-size calculation can be obtained from the corresponding two-proportion formulation. The overall expected event probability is the prevalence-weighted average of P0 and P1.
Let q be the proportion of subjects with X=1, so that 1−q is the proportion with X=0. Let pE be the prevalence-weighted event probability:
The continuous sample-size estimate is:
For a two-sided test, zα = Φ−1(1−α/2). For a one-sided test, zα = Φ−1(1−α). In both cases, zβ = Φ−1(power).
The calculator reports the continuous estimate rounded to the nearest whole subject, matching the rounding convention used in the this method validation example. The displayed group allocation is then obtained from the specified percentage of subjects with X=1.
the relevant methodological literature provides a validation example with a 7% baseline probability, odds ratio 1.5, 90% power, two-sided alpha 0.05, and 50% of subjects having X=1. The corresponding alternative probability is approximately 0.10145. The continuous calculation gives N = 3326.4064, which rounds to 3326 subjects. The resulting calculated power is approximately 0.89997.
This procedure is appropriate when the primary predictor of interest is binary, such as treatment versus control, exposed versus unexposed, or presence versus absence of a characteristic. The odds ratio is the multiplicative change in the odds of Y=1 associated with X changing from 0 to 1.
The calculation assumes a simple logistic regression containing the binary predictor of interest. If additional covariates are included and are correlated with the predictor of interest, the required sample size can increase. this method provides a separate procedure that incorporates the R-squared between the predictor of interest and other covariates.
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.
Hsieh, F.Y. (1989). Sample size tables for logistic regression. Statistics in Medicine, 8(7), 795–802. DOI: 10.1002/sim.4780080704.
the software, LLC. this method Sample Size Software Documentation: Logistic Regression (Legacy), Example 4 — Sample Size for a Binary Covariate. the relevant methodological literature.
Advisor documentation, Regression Tables, ROT9: Logistic Regression for Binary Covariate. The documentation identifies Hsieh (1989) as the source for the normal-approximation formulas used for the single binary-covariate procedure.