cpa.sw.normal: Power calculations for stepped wedge cluster randomized...

Description Usage Arguments Value Note Authors References Examples

View source: R/cpa.sw.normal.R

Description

\loadmathjax

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

Exactly one of alpha, power, nclusters, nsubjects, ntimes, 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.

The stepped wedge model assumed by Hooper et al (2016) is given below:

\mjsdeqn

y_itjk = \mu + \beta_t + X_it\theta + c_ij + (ct)_itj + s_ijk + e_itjk

where \mjseqny_itjk is the outcome for individual \mjseqnk in cluster \mjseqnj of arm \mjseqni at time \mjseqnt. Fixed effects include the overall mean \mjseqn\mu and effects for time \mjseqn\beta_t. The vector \mjseqnX_it is 1 if arm \mjseqni at time \mjseqnt is undergoing the intervention, 0 otherwise. The terms \mjseqnc_ij, \mjseqn(ct)_itj, \mjseqns_ijk, and \mjseqne_itjk correspond to the time invariant cluster random effect, the time-varying cluster random effect, the time invariant subject random effect, and the time-varying subject random effect respectively. Random effects are assumed to be independent and Normally distributed with mean 0 and variances \mjseqn\sigma_C^2, \mjseqn\sigma_CT^2, \mjseqn\sigma_S^2, and \mjseqn\sigma_E^2, respectively.

The total variance of the outcome \mjseqn\sigma^2 is given by

\mjsdeqn\sigma

^2 = \sigma_C^2 + \sigma_CT^2 + \sigma_S^2 + \sigma_E^2

Let \mjseqn\rho, \mjseqn\rho, and \mjseqn\rho be the intracluster correlation, cluster autocorrelation, and subject autocorrelation, respectively. These parameters are given as follows:

\mjsdeqn\rho

= \frac\sigma_C^2 + \sigma_CT^2\sigma_C^2 + \sigma_CT^2 + \sigma_S^2 + \sigma_E^2

\mjsdeqn\rho

_C = \frac\sigma_C^2\sigma_C^2 + \sigma_CT^2

\mjsdeqn\rho

_S = \frac\sigma_S^2\sigma_S^2 + \sigma_E^2

When \mjseqn\rho_S = 0 the design is considered to be a cross-sectional design, with new individuals observed at each time point. When \mjseqn\rho_S > 0 the design is a closed cohort, with repeated measurements on the same individuals at each time point.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
cpa.sw.normal(
  alpha = 0.05,
  power = 0.8,
  nclusters = NA,
  nsubjects = NA,
  ntimes = 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 switching to the intervention condition at each time point.

nsubjects

The number of subjects in each cluster.

ntimes

The number of time points in the trial (not including baseline).

d

The expected treatment effect.

ICC

The intra-cluster correlation, the correlation in outcome measurements between two individuals from the same cluster.

rho_c

The cluster autocorrelation, the correlation between two population means from the same cluster at different times. This value can be used in both cross-sectional and cohort designs.

rho_s

The individual autocorrelation, the correlation between two outcome measurements in the same individual at different times. In a purely cross-sectional design (new subjects are obtained at each time point), this value should be 0. For a cohort design (the same subjects are observed at each time point), this value will be greater than 0.

vart

The total variation of the outcome (the sum of variances from cluster and individual level random effects).

tol

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

Value

The computed argument.

Note

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.

Authors

Jonathan Moyer (jon.moyer@gmail.com), Alexandria C. Sakrejda (acbro0@gmail.com), Ken Kleinman (ken.kleinman@gmail.com)

References

Baio G, Copas A, Ambler G, et al., 2015. Sample size calculation for a stepped wedge trial. Trials. 16:354.

Hooper, R., Teerenstra, S., Hoop, E., and Eldridge, S. (2016) Sample size calculation for stepped wedge and other longitudinal cluster randomised trials. Statist. Med., 35: 4718-4728. doi: 10.1002/sim.7028.

Hussey, M. and Hughes, J. (2007) Design and analysis of stepped wedge cluster randomized trials. Contemp. Clin. Trials, 28: 182-191. doi: 10.1016/j.cct.2006.05.007.

Examples

1
2
3
4
5
6
7
8
9
# Find the required number of clusters switching to intervention at each time point for a trial 
# with alpha = 0.05, power = 0.80, nsubjects = 50, ntimes = 5, d = 1.5 units, ICC = 0.2,
# rho_c = 0.80, rho_s = 0, and vart = 16 square-units. Note that because rho_s = 0, this is a 
# cross-sectional design.
cpa.sw.normal(nsubjects = 50, ntimes = 5, d = 1.5, ICC = 0.2, rho_c = 0.80, rho_s = 0, vart = 16)
# 
# The result, nclusters = 1.288772, suggests 2 clusters switching per time point 
# should be used. This means that the total number of clusters in the study is 
# nclusters * ntimes = 2 * 5 = 10.

nickreich/clusterPower documentation built on Feb. 3, 2021, 6:54 p.m.