Power Calculation for Stepped Wedge Designs

Tools for power and sample size calculation as well as design diagnostics for longitudinal mixed model settings, with a focus on stepped wedge designs. All calculations are oracle estimates i.e. assume random effect variances to be known (or guessed) in advance. The method is introduced in Hussey and Hughes (2007) , extensions are discussed in Li et al. (2020) .


SteppedPower - Power Calculation for Stepped Wedge Designs

R-CMD-check CRAN version License: MIT CRAN Downloads

Tools for power and sample size calculation, as well as design diagnostics.
For longitudinal mixed model settings, with a focus on stepped wedge designs.

SteppedPower provides power and sample size calculation for parallel, crossover, and stepped wedge designs. It allows for a flexible definition of the covariance structure. It further offers visualisations and diagnostics tools, to assess cluster importance across time points.

Installation

Stable release (CRAN)

install.packages("SteppedPower")

Development versions

devtools::install_github("PMildenb/SteppedPower", build_vignettes = TRUE)   ## stable development version
devtools::install_github("PMildenb/SteppedPower", ref = "devel", build_vignettes = TRUE)  ## latest 

Quick Start

library(SteppedPower)

# SWD with 4 clusters, ICC = 0.1 (via tau), 10 subjects per cluster, and a treatment effect of 0.5
result <- glsPower(
  Cl = rep(1, 4),       # 4 clusters in 4 sequences
  mu0 = 0,              # Mean under control
  mu1 = 0.5,            # Mean under treatment
  sigma = 1,            # Residual standard deviation
  tau = sqrt(0.111),    # Random intercept SD (ICC = tau^2 / (tau^2 + sigma^2) ≈ 0.1)
  N = 10,               # Subjects per cluster
  verbose = 2           # Save additional info, e.g., complete covariance matrix
)

# View power calculation
print(result)

# check the design matrix
plot(result$DesignMatrix)

# check the covariance matrix
plot(result$CovarianceMatrix)

# check influence diagnostics 
plot(result)

Documentation

For more details, see the package vignettes:

vignette("Getting_Started", package = "SteppedPower")

References

  • Hussey S, Hughes JP (2007). "Design and analysis of stepped wedge cluster randomised trials." Contemporary Clinical Trials, 28(2), 182-191. doi:10.1016/j.cct.2006.05.007
  • Li F, et al. (2020). "Mixed model sample size calculations for stepped wedge cluster randomised trials." Statistical Methods in Medical Research. doi:10.1177/0962280220932962

Authors

License

MIT

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("SteppedPower")

0.4.0 by Philipp Mildenberger, 17 days ago


Browse source code at https://github.com/cran/SteppedPower


Authors: Philipp Mildenberger [aut, cre] (ORCID: , Federico Marini [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports Matrix, plotly, Rfast, grDevices, stats, utils

Suggests knitr, rmarkdown, pwr, testthat


See at CRAN