# NOT RUN {
# Estimate power for a trial with 10 clusters in each arm with 20 subjects each,
# with sigma_b_sq = 0.1 in both arms. We expect mean event rates per unit time of
# 20 and 30 in the first and second arms, respectively, and we use 100 simulated
# data sets analyzed by the GEE method.
# }
# NOT RUN {
count.sim = cps.count(nsim = 100, nsubjects = 20, nclusters = 10,
c1 = 20, c2 = 30, sigma_b_sq = 0.1,
family = 'poisson', analysis = 'poisson',
method = 'gee', alpha = 0.05, quiet = FALSE,
allSimData = FALSE, seed = 123)
# }
# NOT RUN {
# The resulting estimated power (if you set seed = 123) should be about 0.8.
# Estimate power for a trial with 10 clusters and 10 subjects per cluster in the
# first arm, 20 clusters and 20 subjects per cluster in the second, and
# sigma_b_sq = 0.1 in both arms. We expect mean event rates per unit time of
# 20 and 30 in the first and second arms, respectively, and we use 100 simulated
# data sets analyzed by the GLMM method.
# }
# NOT RUN {
count.sim = cps.count(nsim = 100, nsubjects = c(10,20), nclusters = c(10,10),
c1 = 20, c2 = 30, sigma_b_sq = 0.1,
family = 'poisson', analysis = 'poisson',
method = 'glmm', alpha = 0.05, quiet = FALSE,
allSimData = FALSE, seed = 123)
# }
# NOT RUN {
# The resulting estimated power (if you set seed = 123) should be about 0.85.
# Estimate power for a trial with 5 clusters in the first arm, those clusters having
# 4, 5, 6, 7, and 7 subjects each, and 10 clusters in the second arm, those
# clusters having 5 subjects each, with sigma_b_sq = 0.1 in the first arm and
# sigma_b_sq2 = .05 in the second arm. We expect mean event rates per unit time
# of 20 and 30 in the first and second arms, respectively, and we use 100 simulated
# data sets analyzed by the GLMM method.
# }
# NOT RUN {
count.sim = cps.count(nsim = 100, nsubjects = c(4, 5, 6, 7, 7, rep(5, times = 10)),
nclusters = c(5,10),
c1 = 20, c2 = 30,
sigma_b_sq = 0.1, sigma_b_sq2 = 0.05,
family = 'poisson', analysis = 'poisson',
method = 'glmm', alpha = 0.05, quiet = FALSE,
allSimData = FALSE, seed = 123)
# }
# NOT RUN {
# The resulting estimated power (if you set seed = 123) should be about 0.75.
# }
Run the code above in your browser using DataLab