Power Calculation for Stepped Wedge Designs
Overview
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) doi:10.1016/j.cct.2006.05.007, extensions are discussed in Li et al. (2020) doi:10.1177/0962280220932962.
glsPower()now supports count outcomes viafamily="poisson"- Added ICC (intracluster correlation) transformation functions:
icc_to_RandEff(),RandEff_to_icc(),RandEff_to_alpha012(), andalpha012_to_RandEff()for converting between random effects variances and ICC/CAC/IAC parameters - Added vignette on binomial and count outcomes, with pre-calculated contour plots
- In
glsPower(), the argumentNnow overrides theNstored in a supplied
DesMat object
glsPower()now fails gracefully (with a warning) if the information content
cannot be calculated
- Character input arguments (e.g.
dsntype,family) now throw an error if no
known option is sufficiently similar, instead of silently choosing the closest match
- Diagnostic output now uses
message()instead ofprint() - Vignette plots now use the plotly partial bundle to reduce package size
- Changed covariance matrix construction to use
fbdiag(fast block diagonal matrix)
Show all changes in 0.4.0Hide the rest of the changes in 0.4.0
plot_CellWeights()now treatsNAentries inincompMatas unobserved
cluster periods
- Replaced
\()withfunction()for backward compatibility with older R versions - Fixed typo in
RandEff_to_alpha - Added tests for
construct_DesMat(),construct_CovMat(), andglsPower() - Updated vignettes and improved documentation with additional links in help files
- Roxygen documentation now uses markdown format; re-roxygenised all documentation
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 25includes a package overview page
- Examples that run
- 100%12 run in a plain check
- Exported functions with examples
- 61%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 16%
Downloads
Dependencies
Installing SteppedPower adds 68 packages (39 with compiled code, 65 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.4.0Latest
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 0.3.52024-04-29 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.3.42023-09-13 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.3.22022-07-05 · diff ↗ ·
removed 2 exports
compute_wlsPower, wlsPoweradded 3 exports
compute_InfoContent, compute_glsPower, glsPower - RR 4.2.0 released · 2022-04-22
- 0.3.1
- 0.2.02021-07-07 · diff ↗ ·
removed 1 export
construct_timeadjustadded 5 exports
RandEff_to_alpha012, VarClosed_Kasza, VarClosed_Li, alpha012_to_RandEff, construct_timeAdjust - RR 4.1.0 released · 2021-05-18
- 0.1.02021-02-04
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2021-02-04
- Total releases
- 7 / 5 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5.0
- Download size
- 2.1 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("SteppedPower")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.