# NOT RUN {
# Estimate power for a trial with 10 clusters in each arm, 20 subjects in
# each cluster, with a probability of 0.8 in the first arm and 0.5 in the
# second arm, with a sigma_b_sq = 1 in the first arm sigma_b_sq = 1.2 in
# the second arm.
# }
# NOT RUN {
binary.sim = cps.binary(nsim = 100, nsubjects = 20,
nclusters = 10, p1 = 0.8,
p2 = 0.5, sigma_b_sq = 1,
sigma_b_sq2 = 1.2, alpha = 0.05,
method = 'glmm', allSimData = FALSE)
# }
# NOT RUN {
# Estimate power for a trial just as above, except that in the first arm,
# the clusters have 10 subjects in 9 of the 10 clusters and 100 in the tenth
# cluster, while in the second arm all clusters have 20 subjects.
# }
# NOT RUN {
binary.sim2 = cps.binary(nsim = 100,
nsubjects = c(c(rep(10,9),100), rep(20,10)),
nclusters = 10, p1 = 0.8,
p2 = 0.5, sigma_b_sq = 1,
sigma_b_sq2 = 1.2, alpha = 0.05,
method = 'gee', allSimData = FALSE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab