# 1. Power for n_1 = n_2 = 30 when the two population proportions are
# 0.6 and 0.3. The value comes from enumerating the conditional
# reference set the test itself uses, not from a normal
# approximation, so it is the power of the test as conducted.
power_fisher_exact(n_1 = 30, n_2 = 30, p_1 = 0.6, p_2 = 0.3)
# 2. A difference of 0.10 between proportions is much harder to detect:
# 100 per group is not close to enough. Sample size requirements grow
# quickly as the difference between the two proportions shrinks.
power_fisher_exact(n_1 = 100, n_2 = 100, p_1 = 0.45, p_2 = 0.35)
Run the code above in your browser using DataLab