Learn R Programming

clusterPower (version 0.7.0)

cpa.count: Analytic power calculations for parallel arm cluster-randomized trials with count outcomes

Description

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.

Usage

cpa.count(
  alpha = 0.05,
  power = 0.8,
  nclusters = NA,
  nsubjects = NA,
  r1 = NA,
  r2 = NA,
  CVB = NA,
  r1inc = TRUE,
  tol = .Machine$double.eps^0.25
)

Arguments

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.

Value

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.

Authors

Jonathan Moyer (jon.moyer@gmail.com), Ken Kleinman (ken.kleinman@gmail.com)

Testing details

This function has been verified against reference values from CRTsize::n4incidence, and clusterPower::cps.count.

References

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.

Examples

Run this code
# NOT RUN {
# 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.

# }

Run the code above in your browser using DataLab