powered by
Computer average power of many two proportion z-tests.The power calculation of two proportion z-test is based on asymptotic normal approximation.
average.power.twoprop(n, alpha, p1, p2, alternative)
Average power estimate for multiple testing procedure
per-group sample size (scalar)
p-value threshold (scalar)
probability in one group (vector)
probability in other group (vector)
one- or two-sided test
set.seed(1234); p1 = sample(seq(0,0.5,0.1),40,replace = TRUE); p2 = sample(seq(0.5,1,0.1),40,replace = TRUE); average.power.twoprop(n = 30, alpha = 0.05, p1 = p1,p2 = p2,alternative="two.sided")
Run the code above in your browser using DataLab