Obtains the power given sample size or obtains the sample size given power for difference in two-sample multinomial responses.
getDesignTwoMultinom(
beta = NA_real_,
n = NA_real_,
ncats = NA_integer_,
pi1 = NA_real_,
pi2 = NA_real_,
allocationRatioPlanned = 1,
rounding = TRUE,
alpha = 0.05
)
An S3 class designTwoMultinom
object with the following
components:
power
: The power to reject the null hypothesis.
alpha
: The two-sided significance level.
n
: The maximum number of subjects.
ncats
: The number of categories of the multinomial response.
pi1
: The prevalence of each category for the treatment group.
pi2
: The prevalence of each category for the control group.
effectsize
: The effect size for the chi-square test.
allocationRatioPlanned
: Allocation ratio for the active treatment
versus control.
rounding
: Whether to round up sample size.
The type II error.
The total sample size.
The number of categories of the multinomial response.
The prevalence of each category for the treatment group.
Only need to specify the valued for the first ncats-1
categories.
The prevalence of each category for the control group.
Only need to specify the valued for the first ncats-1
categories.
Allocation ratio for the active treatment versus control. Defaults to 1 for equal randomization.
Whether to round up sample size. Defaults to 1 for sample size rounding.
The two-sided significance level. Defaults to 0.05.
Kaifeng Lu, kaifenglu@gmail.com
(design1 <- getDesignTwoMultinom(
beta = 0.1, ncats = 3, pi1 = c(0.3, 0.35),
pi2 = c(0.2, 0.3), alpha = 0.05))
Run the code above in your browser using DataLab