Proportions: One and Two Groups
Exact sample size calculation for comparing two independent proportions with a two-sided Fisher's Exact Test. The calculator enumerates all possible 2×2 outcomes under the assumed alternative proportions and finds the smallest equal group size that reaches the requested statistical power.
Fisher's Exact Test evaluates the association between two binary variables in a 2×2 contingency table. For sample-size planning, the exact power is obtained by enumerating every possible pair of binomial outcomes from the two independent groups under the assumed alternative proportions.
For a particular table, let x1 and x2 be the numbers of successes in Groups 1 and 2, with total successes m = x1 + x2. Conditional on m, the null distribution is hypergeometric. The this method implementation describes the Fisher statistic as:
For each possible value of m, the conditional rejection region consists of outcomes having a Fisher statistic at least as extreme as the critical value determined by the target α. Equivalently, this implementation identifies the tables whose conditional hypergeometric probability is sufficiently small to fall in the two-sided rejection region.
Once the exact rejection region has been determined, power is calculated under the alternative proportions P1 and P2 by summing the joint probability of every outcome in that rejection region:
The calculator searches for the smallest equal sample size per group for which the exact enumerated power is at least the requested target power. Because Fisher's Exact Test is discrete, the achieved power and actual type-I error can differ from their nominal targets.
The reported N1 and N2 are the evaluable sample sizes required in the two groups. The total sample size is N = N1 + N2. This calculator assumes equal allocation, so N1 = N2.
the published Example 2 specifies P1 = 0.54, P2 = 0.44, a two-sided α = 0.05 test, and 90% target power with equal allocation. Exact binomial enumeration gives 546 subjects per group, or 1,092 total, with achieved power of 0.90028 and actual alpha of 0.04207.
Validation target: N1 = 546, N2 = 546, N = 1092; exact power = 0.90028; actual α = 0.04207.
Bennett, B. M., & Hsu, P. (1960). On the Power Function of the Exact Test for the 2×2 Contingency Table. Biometrika, 47(3–4), 393–398. doi:10.2307/2333309.
the software, LLC. this method Sample Size Software: Fisher's Exact Test for Two Proportions, Chapter 194. the relevant methodological literature. The documentation describes the exact Fisher power calculation, binomial enumeration, sample-size procedure, and published validation examples.