Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

power

Power of Fisher's Exact Test for Comparing Proportions


Description

Calculate by simulation the power of Fisher's exact test for comparing two proportions given two margin counts.

Usage

power.fisher.test(p1, p2, n1, n2, alpha=0.05, nsim=100, alternative="two.sided")

Arguments

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".

Details

Computes the power of Fisher's exact test for testing the null hypothesis that p1 equals p2 against the alternative that they are not equal.

Value

Estimated power of the test.

Author(s)

Gordon Smyth

See Also

Examples

power.fisher.test(0.5,0.9,20,20) # 70% chance of detecting difference

statmod

Statistical Modeling

v1.4.36
GPL-2 | GPL-3
Authors
Gordon Smyth [cre, aut], Yifang Hu [ctb], Peter Dunn [ctb], Belinda Phipson [ctb], Yunshun Chen [ctb]
Initial release
2021-05-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.