Learn R Programming

clusterPower (version 0.7.0)

cpa.did.normal: Power calculations for difference-in-difference cluster randomized trials, continuous outcome

Description

Compute the power of a difference-in-difference cluster randomized trial design with a continuous outcome, or determine parameters to obtain a target power.

Usage

cpa.did.normal(
  alpha = 0.05,
  power = 0.8,
  nclusters = NA,
  nsubjects = NA,
  d = NA,
  ICC = NA,
  rho_c = NA,
  rho_s = NA,
  vart = NA,
  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 mean of the cluster sizes, or a vector of cluster sizes for one arm.

d

The difference in mean change between conditions (i.e. "difference-in-difference").

ICC

The intraclass correlation.

rho_c

The correlation between baseline and post-test outcomes at the cluster level. This value can be used in both cross-sectional and cohort designs. If this quantity is unknown, a value of 0 is a conservative estimate.

rho_s

The correlation between baseline and post-test outcomes at the subject level. This should be used for a cohort design or a mixture of cohort and cross-sectional designs. In a purely cross-sectional design (baseline subjects are completely different from post-test subjects), this value should be 0.

vart

The total variation of the outcome (the sum of within- and between-cluster variation).

tol

Numerical tolerance used in root finding. The default provides at least four significant digits.

Value

The computed argument.

Authors

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

Details

Exactly one of alpha, power, nclusters, nsubjects, d, ICC, rho_c, rho_s, and vart must be passed as NA. Note that alpha andpower have non-NA defaults, so if those are the parameters of interest they must be explicitly passed as NA.

If nsubjects is a vector the values, nclusters will be recalculated using the values in nsubjects.

References

Rutterford C, Copas A, Eldridge S. (2015) Methods for sample size determination in cluster randomized trials. Int J Epidemiol. 44(3):1051-1067.

Teerenstra S, Eldridge S, Graff M, de Hoop E, Borm, GF. (2012) A simple sample size formula for analysis of covariance in cluster randomized trials. Statist Med. 31:2169-2178

Examples

Run this code
# NOT RUN {
# Find the number of clusters per condition needed for a trial with alpha = 0.05, 
# power = 0.80, nsubjects = 100, d = 0.50 units, ICC = 0.05, rho_c = 0.50, rho_s = 0.70,
# and vart = 1 unit.
cpa.did.normal(nsubjects = 100 , d = 0.5, ICC = 0.05, rho_c = 0.50, rho_s = 0.70, vart = 1)
# 
# The result, nclusters = 4.683358, suggests 5 clusters per condition should be used.

# }

Run the code above in your browser using DataLab