fisherPower: Power analysis for fisher test

Description Usage Arguments Value Author(s) See Also Examples

View source: R/fisherPower.r

Description

Computes the power of fishers exact test by means of simulation.

Usage

1
fisherPower(pA, pB, nA, nB, alpha = 0.05, nRepl = 1000)

Arguments

pA

True proportion in 1st sample. Not to be confused with odds.

pB

True proportion in 2nd sample. Not to be confused with odds.

nA

Size of 1st sample.

nB

Size of 2nd sample.

alpha

Alpha error (default 0.05).

nRepl

Number of simulations to be performed.

Value

The power of the test, i.e. 1-Beta.

Author(s)

David Kneis david.kneis@tu-dresden.de

See Also

Method power.fisher.test from package statmod yields essentially the same results.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
nA <- 814
pA <- 29/814
nB <- 276
pB <- 1/276
print(fisherPower(pA, pB, nA, nB))
## Not run: 
library("statmod")
power.fisher.test(p1=pA, p2=pB, n1=nA, n2=nB, alpha=0.05, nsim=1000, alternative="two.sided")

## End(Not run)

dkneis/knut documentation built on Jan. 7, 2020, 4:27 a.m.