power.fisher.test | R Documentation |
Calculate by simulation the power of Fisher's exact test for comparing two proportions given two margin counts.
power.fisher.test(p1, p2, n1, n2, alpha=0.05, nsim=100, alternative="two.sided")
p1 |
first proportion to be compared. |
p2 |
second proportion to be compared. |
n1 |
first sample size. |
n2 |
second sample size. |
alpha |
significance level. |
nsim |
number of data sets to simulate. |
alternative |
indicates the alternative hypothesis and must be one of "two.sided", "greater" or "less". |
Estimates the power of Fisher's exact test for testing the null hypothesis that p1
equals p2
against the alternative that they are not equal.
The power is estimated by simulation.
The function generates nsim
pairs of binomial deviates and calls fisher.test
to obtain nsim
p-values.
The required power is tnen the proportion of the simulated p-values that are less than alpha
.
Estimated power of the test.
Gordon Smyth
fisher.test
, power.t.test
power.fisher.test(0.5,0.9,20,20) # 70% chance of detecting difference
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.