cpa.sw.count: Power calculations for stepped-wedge trials with a count...

Description Usage Arguments Value Author(s) References Examples

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

Description

This function uses the SWSamp package by Gianluca Baio for estimating power based on analytic formula of Hussey and Hughes (2007) where sample size calculations are based on an assumption of a normally-distributed outcome.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cpa.sw.count(
  lambda1,
  RR,
  nclusters,
  steps,
  nsubjects,
  ICC = 0.01,
  alpha = 0.05,
  which.var = "within",
  X = NULL,
  all.returned.objects = FALSE
)

Arguments

lambda1

Baseline rate for outcome of interest

RR

Estimated relative risk of the intervention

nclusters

Number of clusters

steps

Number of time steps. Baseline is assumed.

nsubjects

Average size of each cluster

ICC

Intra-class correlation coefficient (default = 0.01)

alpha

Significance level (default=0.05)

which.var

String character specifying which variance to report. Options are the default value 'within' or 'total'.

X

A design matrix indicating the time at which each of the clusters should switch to the intervention arm. Default is NULL and this matrix is automatically computed, but can it can be passed as a user-defined matrix with (nclusters) rows and (steps + 1) columns.

all.returned.objects

Logical. Default = FALSE, indicating that only the estimated power should be returned. When TRUE, all objects (listed below) are returned.

Value

power

The resulting power

When all.returned.objects = TRUE, returned items also include:

sigma.y

The estimated total (marginal) sd for the outcome

sigma.e

The estimated residual sd

sigma.a

The resulting cluster-level sd

setting

A list including the following values: - n.clusters = The number of clusters (nclusters) - n.time.points = The number of steps in the SW design (steps) - avg.cluster.size = The average cluster size (nsubjects) - design.matrix = The design matrix for the SWT under consideration

Author(s)

Alexandria C. Sakrejda (acbro0@umass.edu)

Ken Kleinman (ken.kleinman@gmail.com)

References

Baio, G; Copas, A; Ambler, G; Hargreaves, J; Beard, E; and Omar, RZ Sample size calculation for a stepped wedge trial. Trials, 16:354. Aug 2015.

Hussey M and Hughes J. Design and analysis of stepped wedge cluster randomized trials. Contemporary Clinical Trials. 28(2):182-91. Epub 2006 Jul 7. Feb 2007

Examples

1
cpa.sw.count(lambda1 = 1.75, RR = 0.9, nclusters = 21, steps = 6, nsubjects = 30, ICC = 0.01)

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