Skip to main content

    Method document

    Sample size to detect an odds ratio

    How many cases and controls are needed to show that an exposure is associated with an outcome, from the expected exposure among controls and either the exposure among cases or the odds ratio. Covers unequal numbers of controls per case and dropout.

    Engine version 1.0.0 · Reviewed 1 October 2026

    See also: Sample size for a common odds ratio across strata (Cochran–Mantel–Haenszel)

    https://statwisely.com/methods/odds-ratio/

    When to use it

    • An unmatched case-control study testing whether an exposure is more, or less, common among cases.

    Not for

    • Matched case-control studies, which need a conditional analysis and its own calculation.
    • Comparisons made within strata, such as centres or age bands, with one odds ratio common to them. Use the stratified (Cochran–Mantel–Haenszel) tab.
    • Estimating the odds ratio to a stated precision. Use the odds ratio under “Estimate precisely”.
    • Odds ratios adjusted for other variables. Use logistic regression.

    Notation

    nn
    Number of cases
    rar_a
    Controls per case
    p1, p2p_1,\ p_2
    Expected exposure among cases and among controls
    pˉ\bar{p}
    Exposure in the two groups combined
    OR\mathrm{OR}
    Odds ratio
    α\alpha
    Significance level: the chance of a false positive
    1−β1-\beta
    Power: the chance of detecting the effect if it is real
    qq
    Expected dropout

    Formulas

    Exposure among cases from the odds ratio

    p1=OR  p21+p2(OR−1)p_1 = \frac{\mathrm{OR}\;p_2}{1 + p_2(\mathrm{OR} - 1)}

    When the odds ratio is given rather than p₁, this is the exposure among cases it implies.

    Cases needed

    n=⌈[z1−α/2(1+1ra)pˉ(1−pˉ)+z1−βp1(1−p1)+p2(1−p2)ra]2(p1−p2)2⌉,pˉ=p1+rap21+ran = \left\lceil \frac{\left[z_{1-\alpha/2}\sqrt{\left(1 + \tfrac{1}{r_a}\right)\bar{p}(1-\bar{p})} + z_{1-\beta}\sqrt{p_1(1-p_1) + \tfrac{p_2(1-p_2)}{r_a}}\right]^{2}}{(p_1 - p_2)^{2}} \right\rceil, \qquad \bar{p} = \frac{p_1 + r_a p_2}{1 + r_a}

    Detecting an odds ratio different from 1 is detecting a difference in exposure between cases and controls, so the calculation is the comparison of two proportions [1, 2]. Controls are ⌈r_a n⌉; the test is two-sided.

    Dropout

    nrecruit=⌈n1−q⌉n_{\text{recruit}} = \left\lceil \frac{n}{1 - q} \right\rceil

    Applied last, to the participants actually recruited.

    Parameters

    Exposure among controlsp2p_2

    Values: Between 0 and 1

    Often known from population surveys, since controls represent the population the cases arose from.

    Exposure among casesp1p_1Optional

    Values: Between 0 and 1

    Give this or the odds ratio.

    Odds ratio to detectOR\mathrm{OR}Optional

    Values: Above 0, not 1

    The smallest odds ratio worth detecting, instead of p₁.

    Controls per caserar_aOptional

    Values: Above 0; 1 for equal numbers

    When cases are scarce, recruiting 2 to 4 controls per case reduces the cases needed; beyond about 4 there is little further gain.

    Significance levelα\alpha

    Values: Between 0 and 1; usually 0.05

    The false-positive rate you accept. A smaller α, for example to allow for several primary outcomes, needs a larger sample.

    Power1−β1-\beta

    Values: Between 0 and 1; usually 0.80 or 0.90

    The chance of a significant result if the assumed effect is real. Funders and ethics committees commonly expect at least 0.80.

    Expected dropoutqqOptional

    Values: 0% up to, but not including, 100%

    The share of participants expected to provide no outcome, from comparable studies. Recruiting more restores the numbers, not the comparability of the groups: if dropout is related to the outcome, the estimate can still be biased.

    Assumptions

    • Cases and controls are independent, unmatched samples, and controls represent the population the cases arose from.
    • The analysis is a crude comparison; adjustment for confounders needs more participants.
    • Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.

    Worked examples

    From the two exposures

    Exposure expected in 0.4 of cases and 0.2 of controls, an odds ratio of 2.67; α = 0.05, 80% power: 82 cases and 82 controls.

    Cases: 82 · Controls: 82 · Total: 164

    Protocol statement

    To detect an odds ratio of 2.667 with 80% power at a two-sided significance level of 0.05, using a comparison of exposure between cases and controls, and assuming exposure in 20% of controls, the required sample size is 82 cases and 82 controls (164 in total). Calculated with StatWisely (statwisely.com) using: n₁ = [z_(1-α/2)√((1+1/r)p̄q̄) + z_(1-β)√(p₁q₁+p₂q₂/r)]²/(p₁-p₂)². These are planning estimates; confirm the final design with a qualified statistician.

    Open this example in the calculator

    From the odds ratio

    An odds ratio of 2 with 0.2 of controls exposed means p₁ = 2 × 0.2 / 1.2 = 0.333: 172 cases and 172 controls.

    Cases: 172 · Controls: 172 · Total: 344

    Open this example in the calculator

    Two controls per case

    The first example with 2 controls per case: 60 cases and 120 controls, fewer cases at the cost of more participants overall.

    Cases: 60 · Controls: 120 · Total: 180

    Open this example in the calculator

    Allowing for incomplete data

    Expecting 10% to have no usable exposure data: 82 / 0.9 = 91.1, so 92 cases and 92 controls are recruited.

    Cases: 82 · Controls: 82 · Total: 164 · To recruit: 92 and 92

    Protocol statement

    To detect an odds ratio of 2.667 with 80% power at a two-sided significance level of 0.05, using a comparison of exposure between cases and controls, and assuming exposure in 20% of controls, the required sample size is 82 cases and 82 controls (164 in total). Allowing for 10% dropout, 92 cases and 92 controls (184 in total) should be recruited. Calculated with StatWisely (statwisely.com) using: n₁ = [z_(1-α/2)√((1+1/r)p̄q̄) + z_(1-β)√(p₁q₁+p₂q₂/r)]²/(p₁-p₂)². These are planning estimates; confirm the final design with a qualified statistician.

    Open this example in the calculator

    Validation

    • Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
    • An independent implementation in R recomputes this test every night and before each production release, and the results are compared with the engine’s.

    How to cite

    StatWisely. Sample size to detect an odds ratio. Method document, engine version 1.0.0, reviewed 2026-10-01. https://statwisely.com/methods/odds-ratio/

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

    References

    1. 1.Lwanga SK, Lemeshow S. Sample Size Determination in Health Studies: A Practical Manual. Geneva: World Health Organization; 1991.
    2. 2.Fleiss JL, Levin B, Paik MC. Statistical Methods for Rates and Proportions. 3rd ed. Hoboken, NJ: John Wiley & Sons; 2003.