
Last chance! 50% off unlimited learning
Sale ends in
Calculate power and sample size for comparison of 2 proportions for both balanced and unbalanced designs.
prop_power(n, n1, n2, p1, p2, fraction = 0.5, alpha = 0.05,
power = NULL, alternative = c("two.sided", "one.sided"), odds.ratio,
percent.reduction, ...)
total sample size.
sample size in group 1.
sample size in group 2.
group 1 proportion.
group 2 proportion.
fraction of total observations that are in group 1.
significance level/type 1 error rate.
desired power, between 0 and 1.
alternative hypothesis, one- or two-sided test.
odds ratio comparing p2 to p2.
percent reduction of p1 to p2.
further arguments passed to or from other methods.
a list with class "prop_power" containing the following components:
the total sample size
the sample size in group 1
the sample size in group 2
the proportion in group 1
the proportion in group 2
calculated or desired power
level of significance
Power calculations are done using the methods described in `stats::power.prop.test`, `Hmisc::bsamsize`, and `Hmisc::bpower`.
[stats::power.prop.test], [Hmisc::bsamsize], [Hmisc:bpower]
# NOT RUN {
prop_power(n = 220, p1 = 0.35, p2 = 0.2)
prop_power(p1 = 0.35, p2 = 0.2, fraction = 2/3, power = 0.85)
prop_power(p1 = 0.35, n = 220, percent.reduction = 42.857)
prop_power(p1 = 0.35, n = 220, odds.ratio = 0.4642857)
# }
Run the code above in your browser using DataLab