# NOT RUN {
# For a 3-arm trial with 4, 4, and 5 clusters in each arm, respectively,
# specify the number of subjects in each cluster with 3 vectors in a list,
# each vector representing a study arm. For each cluster, in no particular
# order, denote the number of subjects. In this example, the first arm
# contains 150, 200, 50, and 100 subjects in each of the 4 clusters. The second
# arm contains 50, 150, 210, and 100 subjects in each of 4 clusters, while
# the third arm contains 70, 200, 150, 50, and 100 subjects in each of 5
# clusters. The expected outcomes for each arm are 10, 55, and 65, and
# the sigma_b_sq values are 1, 1, and 2, respectively. Assuming
# seed = 123, the overall power for this trial should be 0.81.
# }
# NOT RUN {
nsubjects.example <- list(c(150, 200, 50, 100), c(50, 150, 210, 100),
c(70, 200, 150, 50, 100))
counts.example <- c(10, 55, 65)
sigma_b_sq.example <- c(1, 1, 2)
count.ma.rct.unbal <- cps.ma.count(nsim = 100,
narms = 3,
nsubjects = nsubjects.example,
counts = counts.example,
sigma_b_sq = sigma_b_sq.example,
alpha = 0.05, seed = 123)
# }
# NOT RUN {
# For a different trial with 4 arms, each arm has 4 clusters which
# each contain 100 subjects. Expected counts for each arm are 30
# for the first arm, 35 for the second, 70 for the third, and 40
# for the fourth. Similarly, sigma_b_sq for each arm are 1
# for the first arm, 1.2 for the second, 1 for the third, and 0.9
# for the fourth. Assuming seed = 123, the overall power for this
# trial should be 0.84
# }
# NOT RUN {
count.ma.rct.bal <- cps.ma.count(nsim = 10, nsubjects = 100, narms = 4,
nclusters = 25, counts = c(30, 35, 70, 40),
sigma_b_sq = c(1, 1.2, 1, 0.9), seed = 123)
# }
Run the code above in your browser using DataLab