Compute power of test, or determine parameters to obtain target power for equal and unequal sample sizes.
power_prop_test(
n = NULL,
p1 = NULL,
p2 = NULL,
sig.level = 0.05,
power = NULL,
ratio = 1,
alternative = c("two.sided", "one.sided"),
tol = .Machine$double.eps^0.25
)
Object of class power.htest
, a list of the arguments (including the computed one) augmented with method
and note
elements.
Number of observations (in group 1)
Probability in one group
Probability in other group
Significance level (Type I error probability)
Power of test (1 minus Type II error probability)
The ratio n2/n1 between the larger group and the smaller group. Should be a value equal to or greater than 1 since n2 is the larger group. Defaults to 1 (equal group sizes)
String. Can be one- or two-sided test. Can be abbreviated.
Numerical tolerance used in root finding, the default providing (at least) four significant digits
Claus Ekstrom claus@rprimer.dk
Exactly one of the parameters n
, delta
, power
, sd
, sig.level
, ratio
sd.ratio
must be passed as NULL, and that parameter is determined from the others. Notice that the last two have non-NULL defaults
so NULL must be explicitly passed if you want to compute them.
power.prop.test
, power_t_test
, power.t.test
power_prop_test(n=NULL, p1=.65, p2=.85, power=.8, ratio=2)
Run the code above in your browser using DataLab