Sample size required to detect a given Odds Ratio
Determine the required sample size for an Odds ratio.
Input parameters
| Field | Symbol | Meaning |
|---|---|---|
| Type I error – Alpha | $\alpha$ | The significance level of the two-sided test that will later be used to compare the two groups. A value of 0.05 means a 5% chance of concluding there is an association when in fact there is none (a false positive). |
| Type II error – Beta | $\beta$ | The accepted chance of missing a real effect of the specified odds ratio (a false negative). Power is \(1-\beta\); a Beta of 0.20 corresponds to 80% power. |
| Odds ratio | $OR$ | The smallest odds ratio the study should be able to detect. Values further from 1 are easier to detect and need fewer subjects; values close to 1 require much larger samples. |
| Baseline (reference group, group 1) proportion | $p_1$ | The expected proportion (entered as a percentage) with the outcome/exposure in the reference group — e.g. the expected exposure rate among controls, or the event rate in group 1. This, together with the odds ratio, determines the proportion expected in group 2. |
| Ratio of sample sizes in Group 1 / Group 2 | $k$ | The intended allocation ratio between the two groups. A ratio of 1 means equal group sizes; other values allow, for example, recruiting more controls than cases. |
Deriving the group 2 proportion
The dialog asks only for the proportion in group 1 and the odds ratio to detect, not the proportion in group 2 directly. The proportion in group 2, \(p_2\), is derived from these using the definition of the odds ratio:
$$ p_2 = \frac{OR \cdot p_1}{1 - p_1 + OR \cdot p_1} $$Sample size formula
Given \(p_1\), \(p_2\), the significance level \(\alpha\), the desired power \(1-\beta\), and the allocation ratio \(k = n_2/n_1\), the (uncorrected) required size of group 1 is obtained from the standard normal-approximation formula for comparing two proportions:
$$ n_1 = \frac{\left(z_{\alpha/2}\sqrt{\left(1+\dfrac{1}{k}\right)\bar{p}(1-\bar{p})} \;+\; z_{\beta}\sqrt{p_1(1-p_1) + \dfrac{p_2(1-p_2)}{k}}\right)^2} {(p_1 - p_2)^2} $$where the pooled proportion is
$$ \bar{p} = \frac{p_1 + k \, p_2}{1 + k} $$and \(z_{\alpha/2}\), \(z_{\beta}\) are the standard normal quantiles corresponding to the chosen \(\alpha\) and \(\beta\) (e.g. \(z_{0.025} = 1.96\), \(z_{0.20} = 0.8416\) for the default 5%/80% setting). The size of group 2 is then \(n_2 = k \cdot n_1\).
The Casagrande-Pike-Smith continuity correction
The formula above is based on a normal approximation and tends to underestimate the sample size needed, particularly for the moderate sample sizes typical of case-control and cohort comparisons. To correct for this, a continuity correction due to Casagrande, Pike & Smith is applied to the uncorrected value \(n_1\) obtained above:
$$ n_1' = \frac{n_1}{4}\left(1 + \sqrt{1 + \frac{2(k+1)}{k \, n_1 \, |p_1 - p_2|}}\right)^{2} $$This corrected value \(n_1'\) (rounded up to the next whole subject) is reported as the required sample size for group 1, with \(n_2' = k \cdot n_1'\) (also rounded up) reported for group 2. Setting \(k = 1\) reduces the correction to its familiar equal-allocation form:
$$ n_1' = \frac{n_1}{4}\left(1 + \sqrt{1 + \frac{4}{n_1 \, |p_1 - p_2|}}\right)^{2} $$Reference
Armitage P, Berry G, Matthews JNS. Statistical Methods in Medical Research, 4th ed. Blackwell Science, 2002 (Table A9).
How to cite this page
- MedCalc Software Ltd. Sample size required to detect a given Odds Ratio. https://www.medcalc.org/en/calc/sample-size-odds-ratio.php (Version 24.0; accessed October 11, 2026)