power.CA.test {multiCA} | R Documentation |
Power calculations for the Cochran-Armitage trend test
Description
Power calculations for the Cochran-Armitage trend test
Usage
power.CA.test(
N = NULL,
power = NULL,
pvec = NULL,
scores = seq_along(pvec),
n.prop = rep(1, length(pvec)),
sig.level = 0.05,
alternative = c("two.sided", "less", "greater")
)
Arguments
N |
integer, the total sample size of the study. If |
power |
target power. If |
pvec |
numeric vector of hypothesized outcome probabilities in each group. |
scores |
non-decreasing numeric vector of the same length as the number of ordered groups giving the trend test scores. Defaults to linearly increasing values. |
n.prop |
numeric vector describing relative sample sizes of the ordered groups. Will be normalized to sum to 1. Defaults to equal sample sizes. |
sig.level |
significance level |
alternative |
character string specifying the alternative hypothesis |
Value
object of class "power.htest"
References
Nam, J. (1987). A Simple Approximation for Calculating Sample Sizes for Detecting Linear Trend in Proportions. Biometrics, 43(3), 701-705.
Examples
# sample size required to detect with 80% power a decreasing trend over 4 groups
# with 3:2:1:2 sample-size distribution at a 2.5% significance level
power.CA.test(power=0.8, pvec=c(0.4, 0.3, 0.2, 0.1), n.prop=c(3,2,1,2),
alternative = "less", sig.level=0.025)
# power of a 2-sided test to detect a logistic increase with slope 0.2 over 5 groups
# with groups of size 10 with unequal dose spacing
doses <- c(0,1,2,4,8)
p0 <- 0.05 # event probability at lowest dose
logit.props <- log(p0/(1-p0)) + doses * 0.2
p <- 1 / (1 + exp(-logit.props)) # hypothesized probabilities at each dose
power.CA.test(N = 10 * 5, pvec=p, scores = doses)