# NOT RUN {
# Find the number of clusters per condition needed for a trial with alpha = .05,
# power = 0.8, 10 observations per cluster, no variation in cluster size, a difference
# of 1 unit, ICC = 0.1 and a variance of five units:
# }
# NOT RUN {
cpa.normal(nsubjects = 10, d = 1, ICC = .1, vart = 5)
# }
# NOT RUN {
# The result, showing nclusters of greater than 15, suggests 16 clusters per
# condition should be used.
# Find the power achieved with 16 clusters, 10 subjects per cluster,
# difference between condition of 1 unit, ICC = .1, and total variance
# of 5 units:
# }
# NOT RUN {
cpa.normal(power = NA, nclusters = 16, nsubjects = 10, d = 1,
sigma_b_sq = .5, vart = 5)
# }
# NOT RUN {
# The result shows the power is 0.801766.
# Find the power achieved when each trial arm has 5 clusters of
# sizes 100, 50, 25, 100, and 100. When a vector of cluster sizes
# is provided (as in this example), the "ncluster" argument is ignored.
# }
# NOT RUN {
cpa.normal(alpha = .05, power = NA, nsubjects = c(100, 50, 25, 100, 100),
d = .2, ICC = .1, sigma_b_sq = .1)
# }
# NOT RUN {
# The result shows the power is 0.13315.
# Find the power achieved with 20 clusters per arm, where
# the cluster sizes vary but have a mean size of 100 and coefficient of variation of .5:
# }
# NOT RUN {
cpa.normal(alpha = .05, power = NA, nclusters = 20, nsubjects = 100, CV = .5,
d = .2, ICC = .1, sigma_b_sq = .1)
# }
# NOT RUN {
# The result shows the power is 0.4559881.
# }
Run the code above in your browser using DataLab