Learn R Programming

clusterPower (version 0.7.0)

cpa.did.binary: Power calculations for difference-in-difference cluster randomized trials, dichotomous outcome

Description

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

Usage

cpa.did.binary(
  alpha = 0.05,
  power = 0.8,
  nclusters = NA,
  nsubjects = NA,
  p = NA,
  d = NA,
  ICC = NA,
  rho_c = NA,
  rho_s = 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.

p

The expected mean proportion at the post-test, averaged across both arms.

d

The expected absolute 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.

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, p, d, ICC, rho_c, and rho_s 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.

References

Murray D. Design and Analysis of Group-Randomized Trials. New York, NY: Oxford University Press; 1998.

Examples

Run this code
# NOT RUN {
# Find the number of clusters per condition needed for a trial with alpha = .05,
# power = 0.8, 50 observations per cluster, expected mean post-test proportion of .50,
# expected difference of .1, ICC = 0.05, cluster level correlation of 0.3, and subject level
# correlation of 0.7.
cpa.did.binary(nsubjects=50 ,p=.5, d=.1, ICC=.05, rho_c=.3, rho_s=.7)
#
# The result, showimg nclusters of greater than 32, suggests 33 clusters per
# condition should be used.

# }

Run the code above in your browser using DataLab