# 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, probability
# in condition 1 of .1 and condition 2 of .2, and ICC = 0.1.
# }
# NOT RUN {
cpa.binary(power = 0.08, nsubjects = 10, p1 = 0.1, p2 = 0.2, ICC = 0.1)
# }
# NOT RUN {
#
# The result, showing nclusters of greater than 37, suggests 38 clusters per
# condition should be used.
# Find the minimum detectable p2 > p1, given 38 clusters per condition, 10
# observations per cluster no variation in cluster size, ICC of 0.1, and
# probability of .1 in condition 2, with power of .8.
# }
# NOT RUN {
cpa.binary(power = 0.08, nsubjects = 10, nclusters = 38,
p1 = 0.1, p2 = NA, ICC = 0.1, p1inc = FALSE)
# }
# NOT RUN {
# The result shows that p2 greater than 0.198922 can be detected with at
# least 80% power.
# }
Run the code above in your browser using DataLab