Sample Size for Comparing Two Groups¶
Overview¶
When comparing two groups, the required sample size per group depends on the desired power, significance level, and effect size.
Two-Sample Mean Comparison¶
\[
n = \frac{2(z_{\alpha/2} + z_{\beta})^2 \sigma^2}{\delta^2}
\]
where \(\delta = \mu_1 - \mu_2\) is the minimum detectable difference.
Two-Sample Proportion Comparison¶
\[
n = \frac{(z_{\alpha/2}\sqrt{2\bar{p}(1-\bar{p})} + z_{\beta}\sqrt{p_1(1-p_1) + p_2(1-p_2)})^2}{(p_1 - p_2)^2}
\]