power_NegativeBinomial {PASSED} | R Documentation |
Power Calculation for Comparing Two Negative Binomial Rates
Description
Compute sample size or power for comparing two negative binomial rates.
Usage
power_NegativeBinomial(n1 = NULL, n2 = NULL, power = NULL, sig.level = 0.05,
mu1 = NULL, mu2 = NULL, duration = 1, theta = NULL, equal.sample = TRUE,
alternative = c("two.sided", "one.sided"), approach = 3)
Arguments
n1 |
sample size in group 1, or sample size in each group if |
n2 |
sample size in group 2 |
power |
power of test (1 minus Type II error probability) |
sig.level |
significance level (Type I error probability) |
mu1 |
expected rate of events per time unit for group 1 |
mu2 |
expected rate of events per time unit for group 2 |
duration |
(average) treatment duration |
theta |
theta parameter of negative binomial distribution; see rnegbin |
equal.sample |
equal sample sizes for two groups, see details |
alternative |
one- or two-sided test |
approach |
1, 2, or 3; see Zhu and Lakkis (2014). |
Details
Exactly one of the parameters n1
, n2
, and power
must be passed as NULL, and that parameter is determined from the others.
If equal.sample = TRUE
is used, N in output will denote the number in each group.
The computations are based on the formulas given in Zhu and Lakkis (2014). See power.nb.test for more details.
Value
Object of class "power.htest", a list of the arguments (including the computed one) augmented with note and method elements.
References
H. Zhu and H. Lakkis (2014). Sample size calculation for comparing two negative binomial rates. Statistics in Medicine, 33:376-387.
Examples
# calculate power, equal sizes
power_NegativeBinomial(n1 = 20, mu1 = 1, mu2 = 2, theta = 0.8)
# calculate power, unequal sizes
power_NegativeBinomial(n1 = 80, n2 = 40, mu1 = 1, mu2 = 2, theta = 0.8)
# calculate n
power_NegativeBinomial( mu1 = 1, mu2 = 2, theta = 0.8, power = 0.8)