Learn R Programming

⚠️There's a newer version (0.3.4) of this package.Take me there.

SteppedPower - Sample Size Calculation in Mixed Model Settings with Focus on Stepped Wedge Designs

SteppedPower offers 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.

Installation

To install the development version type
devtools::install_github("PMildenb/SteppedPower", build_vignettes=TRUE)
library(SteppedPower)

Vignette

The vignette can be viewed with vignette("Getting_Started_with_SteppedPower")

Copy Link

Version

Install

install.packages('SteppedPower')

Monthly Downloads

574

Version

0.1.0

License

MIT + file LICENSE

Maintainer

Philipp Mildenberger

Last Published

February 4th, 2021

Functions in SteppedPower (0.1.0)

tTestPwr

Compute Power of a Wald Test computes the power of a scaled Wald test given a standard error, an effect size, the degrees of freedom of the t-distribution and a significance level. Computes the exact power, see second example
wlsPower

Compute power
construct_CovMat

Construct a Covariance Matrix constructs a (block diagonal) covariance matrix. This function calls `construct_CovBlk` (or `construct_CovSubMat` in case of repeated observations of the same individuals) for each block.
print.DesMat

print.DesMat
print.wlsPower

print.wlsPower
construct_DesMat

Construct the Design Matrix Constructs the design matrix with one column for every (fixed) parameter to be estimated and one row for every cluster for every timepoint. This function calls `construct_trtMat` to construct a matrix with `#cluster` columns and `#timepoints` rows, indicating treatment status fore each cluster at each timepoint. This is then transformed into the first column of the design matrix. `construct_CovMat` further calls `construct_timeajust` to get the fixed effect(s) of the timepoints. Note: Unlike the usual notation, the treatment effect is in the first column (for easier access by higher level functions).
construct_trtMat

Construct Treatment Matrix
plot.wlsPower

plot an object of class `wlsPower`
construct_CovBlk

Construct a Block of the Covariance Matrix
construct_timeadjust

Construct the time period adjustment in the design matrix
SteppedPower-pkg

SteppedPower
plot.DesMat

plot.DesMat
construct_CovSubMat

Construct a Block of the Covariance Matrix
compute_wlsPower

Compute Power via weighted least squares