Description Usage Arguments Value Authors Notes Testing details References Examples
Compute the power, number of clusters needed, number of subjects per cluster needed, or other key parameters for a parallel cluster randomized trial with a binary outcome.
Exactly one of alpha
, power
, nclusters
, nsubjects
,
CV
, p1
, p2
, and ICC
must be passed as NA
.
Note that alpha
, power
, and CV
have non-NA
defaults, so if those are the parameters of interest they must be
explicitly passed as NA
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
alpha |
The level of significance of the test, the probability of a Type I error. |
power |
The power of the test, 1 minus the probability of a Type II error. |
nclusters |
The number of clusters per condition. It must be greater than 1. |
nsubjects |
The mean of the cluster sizes. |
CV |
The coefficient of variation of the cluster sizes. When |
p1 |
The proportion with the outcome in one of the conditions, a numeric between 0-1. |
p2 |
The proportion with the outcome in the other condition, a numeric between 0-1. |
ICC |
The intraclass correlation, a numeric between 0-1. (See Details, below.) |
pooled |
Logical indicating if pooled standard error should be used. |
p1inc |
Logical indicating if p1 is expected to be greater than p2.
Only needed if |
tdist |
If |
tol |
Numerical tolerance used in root finding. The default provides at least four significant digits. |
The computed value of the NA parameter (among alpha
, power
,
nclusters
, nsubjects
,
CV
, p1
, p2
, and ICC
) needed to satisfy the power and
sample size equation.
Jonathan Moyer (jon.moyer@gmail.com), Ken Kleinman (ken.kleinman@gmail.com)
This function implements the approach of Donner and Klar (2000). An estimate for the intracluster correlation coefficient (ICC) is used to calculate a design effect that accounts for variance inflation due to clustering.
There are several ways in which estimates for the ICC for a binary outcome can be calculated, as described by Wu, Crespi, and Wong (2012). The user is advised to exercise caution in estimating, generating, and interpreting ICCs in this setting.
Unlike in the case of normal distributed outcomes (cpa.normal), the ICC refers neither to any natural parameter of a data generating model nor to any function of its parameters. For this reason we do not offer the user a option to input the variance between the clusters. If you prefer to use that input, we suggest using the cps.binary function.
This function was inspired by work from Stephane Champely (pwr.t.test) and Peter Dalgaard (power.t.test). As with those functions, 'uniroot' is used to solve power equation for unknowns, so you may see errors from it, notably about inability to bracket the root when invalid arguments are given. This generally means that no solution exists for which the omitted parameter and the supplied parameters fulfill the equation. In particular, the desired power may not be achievable with any number of subjects or clusters.
This function has been verified against reference values from the NIH's GRT
Sample Size Calculator, PASS11, CRTSize::n4props
,
and clusterPower::cps.binary
.
Donner A, Klar N. Design and Analysis of Cluster Randomization Trials in Health Research. London; Arnold; 2000.
Wu S, Crespi CM, Wong WK. Comparison of Methods for Estimating Intraclass Correlation Coefficient for Binary Responses in Cancer Prevention Cluster Randomized Trials. Contemp Clin Trials. 2012; 33(5): 869-880. doi:10.1016/j.cct.2012.05.004 London: Arnold; 2000.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 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)
## End(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)
## End(Not run)
# The result shows that p2 greater than 0.198922 can be detected with at
# least 80% power.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.