cpa.binary: Analytic power calculations for parallel arm...

Description Usage Arguments Value Authors Notes Testing details References Examples

View source: R/cpa.binary.R

Description

\loadmathjax

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
cpa.binary(
  alpha = 0.05,
  power = NA,
  nclusters = NA,
  nsubjects = NA,
  CV = 0,
  p1 = NA,
  p2 = NA,
  ICC = 0.05,
  pooled = FALSE,
  p1inc = TRUE,
  tdist = 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 mean of the cluster sizes.

CV

The coefficient of variation of the cluster sizes. When CV = 0, (default) the clusters all have the same size.

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 p1 or p2 is NA.

tdist

If TRUE use t distribution with df equal to (nclusters - 2). Otherwise use the normal distribution. Default is TRUE.

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, CV, p1, p2, and ICC) needed to satisfy the power and sample size equation.

Authors

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

Notes

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.

Testing details

This function has been verified against reference values from the NIH's GRT Sample Size Calculator, PASS11, CRTSize::n4props, and clusterPower::cps.binary.

References

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.

Examples

 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.

clusterPower documentation built on Jan. 29, 2021, 1:06 a.m.