Description Usage Arguments Value Authors Note Testing details References Examples
Compute the power, number of clusters needed, number of subjects per cluster needed, or other key parameters for a simple parallel cluster randomized trial with a count outcome.
Exactly one of alpha
, power
, nclusters
, nsubjects
,
r1
, r2
, and CVB
must be passed as NA
.
Note that alpha
and power
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 |
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 number of units of person-time of observation per cluster |
r1 |
The mean event rate per unit time in one of the conditions |
r2 |
The mean event rate per unit time in the other condition |
CVB |
The between-cluster coefficient of variation |
r1inc |
Logical indicating if r1 is expected to be greater than r2. This is only important to specify if one of r1 or r2 is NA. |
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
,
r1
, r2
and CVB
) 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 Hayes and Bennet (1999). An estimate for the intracluster correlation coefficient (ICC) is used to calculate a design effect that accounts for variance inflation due to clustering.
The coefficient of variation CVB
is the variance of the cluster rates divided by the
mean of the cluster rates.
The CVB 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 cluster means. If you prefer to use that input, we suggest using the cps.count 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
CRTsize::n4incidence
, and clusterPower::cps.count
.
Donner A, Klar N. Design and Analysis of Cluster Randomization Trials in Health Research. Chichester, UK; 2009.
Hayes JR, Bennett S. Simple sample size calculation for cluster-randomized trials. International Journal of Epidemiology 1999; 28:319-326
Hayes JR, Moulton LH. Cluster Randomized Trials. Boca Raton, FL: CRC Press; 2009.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Find the number of clusters per condition needed for a trial with alpha = 0.05,
# power = 0.80, 10 person-years per cluster, rate in condition 1 of 0.10
# and condition 2 of 0.20, and CVB = 0.10.
cpa.count(nsubjects=10, r1=0.10, r2=0.20, CVB=0.10)
# The result, showimg nclusters of greater than 24, suggests 25 clusters per
# condition should be used.
# Find the largest CVB compatible with 80% power when there are 25 clusters, 10
# subject-units of time per cluster, and a rate of 0.1 and 0.2 in each condition.
cpa.count(nsubjects=10, nclusters= 25,r1=0.10, r2=0.20, CVB=NA)
# Results show that CVB as high as 0.107 can still yield power this high.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.