Skip to main content

    Method document

    Achieved power for logistic regression, binary predictor

    Calculates the power of the Wald test of a binary predictor’s coefficient in logistic regression, from the baseline probability, the odds ratio, the share with the predictor, and its correlation with other covariates.

    Engine version 1.0.0 · Reviewed 3 October 2026

    https://statwisely.com/methods/power-logistic/

    When to use it

    • Assess whether a planned logistic model can detect the association of a yes/no exposure with a yes/no outcome.

    Not for

    • A rare predictor costs power quickly: the information comes from the smaller of the two predictor groups.

    Notation

    NN
    Participants.
    p0,p1p_0, p_1
    Event probabilities without and with the predictor.
    BB
    Share with the predictor.
    pˉ\bar p
    Overall event probability, (1 − B)p₀ + Bp₁.
    RX∣Z2R^2_{X|Z}
    R² of this predictor on the other covariates.

    Formulas

    Power, inverting the sample-size formula

    Power=Φ ⁣(∣p0−p1∣N(1−RX∣Z2)(1−B)−z1−α/tailspˉqˉ/Bp0q0+p1q1(1−B)/B)+Itails=2 Φ ⁣(−∣p0−p1∣N(1−RX∣Z2)(1−B)−z1−α/tailspˉqˉ/Bp0q0+p1q1(1−B)/B)\text{Power}=\Phi\!\left(\frac{|p_0-p_1|\sqrt{N(1-R^2_{X|Z})(1-B)}-z_{1-\alpha/\text{tails}}\sqrt{\bar p\bar q/B}}{\sqrt{p_0q_0+p_1q_1(1-B)/B}}\right)+I_{\text{tails}=2}\,\Phi\!\left(\frac{-|p_0-p_1|\sqrt{N(1-R^2_{X|Z})(1-B)}-z_{1-\alpha/\text{tails}}\sqrt{\bar p\bar q/B}}{\sqrt{p_0q_0+p_1q_1(1-B)/B}}\right)

    Hsieh, Bloch and Larsen’s binary-covariate formula; other covariates shrink the effective sample by 1 − R² [1, 2].

    Parameters

    Sample sizeNN

    Values: Integer, at least 2

    Participants with complete data.

    Odds ratioOR\mathrm{OR}

    Values: Positive, not 1

    Odds of the outcome with the predictor, relative to without it.

    Event probability without the predictorp0p_0

    Values: Between 0 and 1

    Outcome probability in those without the predictor.

    Share with the predictorBB

    Values: Between 0 and 1

    Proportion of the sample with the binary predictor.

    R² with other predictorsRX∣Z2R^2_{X|Z}Optional

    Values: At least 0, below 1

    How well the other covariates explain this predictor; 0 when it is the only one.

    Significance levelα\alpha

    Values: Between 0 and 1

    The type I error rate for the specified test.

    Test directionss

    Values: 1 or 2

    One-sided tests use the upper rejection tail. Two-sided tests split α equally between both tails.

    Assumptions

    • Observations are independent and the logistic model holds; the Wald test is a large-sample approximation.
    • One-sided tests use the upper rejection tail. Two-sided tests split α equally between both tails.

    Worked examples

    A worked input set

    For 400 participants, OR = 2, p₀ = 0.20, 30% with the predictor, and R² = 0.10 with other covariates at α = 0.05: p₁ = 0.333 and the effective sample is 360.

    Sample size: 400

    Open this example in the calculator

    Validation

    • Power is the logistic-regression sample-size formula solved for z_β, with the far tail added for a two-sided test. At the size that calculator returns it reaches the target, one fewer falls short, and it agrees with an independent calculation in R.

    How to cite

    StatWisely. Achieved power for logistic regression, binary predictor. Method document, engine version 1.0.0, reviewed 2026-10-03. https://statwisely.com/methods/power-logistic/

    Cite the original references for the formulas your design uses as well.

    References

    1. 1.Hsieh FY, Bloch DA, Larsen MD. A simple method of sample size calculation for linear and logistic regression. Statistics in Medicine. 1998;17(14):1623–1634.
    2. 2.Faul F, Erdfelder E, Lang AG, Buchner A. G*Power 3: a flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behavior Research Methods. 2007;39(2):175–191.