# NOT RUN {
# Suppose we are planning a multi-arm trial composed of a control arm and
# two treatment arms. It is known that each arm will contain 5 clusters. We
# wish to know the minimum number of subjects per cluster necessary to
# attain 80% power at a 5% level of significance. A pilot study was used to
# determine estimates of the between-arm variance, the between-cluster
# variance, and the within-cluster variance. The observed means of each arm
# in the pilot study were 74, 80, and 86, so the between-arm variance is 36.
# As discussed in the "Details" section above, this can be calculated using
# the command var(c(74,80,86)). The within-cluster and between-cluster
# standard deviations were observed to be 8 and 3, respectively. This means
# the within-cluster and between-cluster variances are 64 and 9, respectively.
# These values are entered into the function as follows:
cpa.ma.normal(narms=3,nclusters=5,vara=36,varc=9,vare=64)
#
# The result, showing nsubjects of greater than 20, suggests 21 subjects per
# cluster should be used.
# }
Run the code above in your browser using DataLab