6.4 Sample size for comparing two groups
A study is too small if it is unlikely to detect an effect of the size that matters, and too large if it spends resources and exposes people to measurement beyond what the question needs. The calculation needs four inputs: the significance level \(\alpha \), the power \(1 - \beta \), the frequency of outcome (or exposure) in the reference group, and the smallest effect worth detecting.
Theorem 6.4.1. To compare proportions \(\pi _1\) and \(\pi _0\) with a two-sided level-\(\alpha \) test of \(\pi _1 = \pi _0\) and power \(1 - \beta \), with \(n\) subjects in group \(1\) and \(kn\) in group \(0\), the required \(n\) is approximately \[ n = \frac {\Bigl \{z_{\alpha /2}\sqrt {(1 + 1/k)\,\bar \pi (1 - \bar \pi )} + z_\beta \sqrt {\pi _1(1 - \pi _1) + \pi _0(1 - \pi _0)/k}\Bigr \}^2}{(\pi _1 - \pi _0)^2} , \] where \(\bar \pi = (\pi _1 + k\pi _0)/(1 + k)\) and \(z_\gamma \) is the upper \(\gamma \) point of the standard normal.
Proof. The test rejects when \(|\hat \pi _1 - \hat \pi _0| > z_{\alpha /2}\,\sigma _0/\sqrt n\), where \(\sigma _0^2 = (1 + 1/k)\bar \pi (1 - \bar \pi )\) is \(n\) times the variance of \(\hat \pi _1 - \hat \pi _0\) under the null hypothesis. Under the alternative, \(\hat \pi _1 - \hat \pi _0\) is approximately normal with mean \(\delta = \pi _1 - \pi _0\) and variance \(\sigma _1^2/n\), where \(\sigma _1^2 = \pi _1(1 - \pi _1) + \pi _0(1 - \pi _0)/k\). Ignoring the negligible probability of rejecting in the wrong direction, the power is \[ P\Bigl (\hat \pi _1 - \hat \pi _0 > \frac {z_{\alpha /2}\sigma _0}{\sqrt n}\Bigr ) = \Phi \Bigl (\frac {\delta \sqrt n - z_{\alpha /2}\sigma _0}{\sigma _1}\Bigr ) . \] Setting this equal to \(1 - \beta \) requires \((\delta \sqrt n - z_{\alpha /2}\sigma _0)/\sigma _1 = z_\beta \), so \(\sqrt n = (z_{\alpha /2}\sigma _0 + z_\beta \sigma _1)/\delta \). □
In a cohort study \(\pi _1, \pi _0\) are the risks \(p_1, p_0\), and \(n\) is the number of exposed subjects. In a case-control study they are the exposure probabilities \(q_1, q_0\) among cases and controls, and \(n\) is the number of cases. There the effect is specified as an odds ratio and the control exposure prevalence \(q_0\), from which \begin {equation} \label {eq:q1} q_1 = \frac {\OR \,q_0}{1 + q_0(\OR - 1)} , \end {equation} obtained by solving \(q_1/(1 - q_1) = \OR \,q_0/(1 - q_0)\).
Example 6.4.2. A cohort study is to detect a risk ratio of \(1.5\) when the risk among the unexposed is \(0.10\), with equal groups, \(\alpha = 0.05\) and power \(0.80\) (\(z_{\alpha /2} = 1.960\), \(z_\beta = 0.842\)). With \(\pi _1 = 0.15\), \(\pi _0 = 0.10\), \(\bar \pi = 0.125\), \begin {gather*} \sigma _0 = \sqrt {2 \times 0.125 \times 0.875} = 0.4677, \\ \sigma _1 = \sqrt {0.15 \times 0.85 + 0.10 \times 0.90} = 0.4664, \\ n = \frac {(1.960 \times 0.4677 + 0.842 \times 0.4664)^2}{0.05^2} = 685.8 \end {gather*} so \(686\) in each group after rounding up. A simulation of \(40{,}000\) such studies gave power \(0.804\).
Example 6.4.3. A case-control study is to detect an odds ratio of \(2\) for an exposure carried by \(20\%\) of controls. By (6.1), \(q_1 = 0.4/1.2 = 0.333\). With one control per case, Theorem 6.4.1 gives \(172\) cases and \(172\) controls. With four controls per case it gives \(103\) cases and \(412\) controls: fewer cases, many more subjects. Which is cheaper depends on whether cases or controls are the scarce resource.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.