Skip to content

An R package providing power calculations for mixed models. The methods are validated in longitudinal and cluster randomized designs.

License

Notifications You must be signed in to change notification settings

SampleSizeShop/mixedPower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The mixedPower Package

The mixedPower package for R (>4.0.0) calculates power for the linear mixed model for longitudinal and cluster randomized designs. The power calculations may be used for designs with or without anticipated missing data.

The package provides companion code for the manuscript:

Kreidler, S. M., Ringham, B. M., Muller, K. E., & Glueck, D. H. A Power Approximation for the Kenward and Roger Wald Test in the Linear Mixed Mode, In review.

Instructions for replicating the manuscript results

The results in the above manuscript were produced using R version 4.0.2. To reproduce the results, perform the following steps:

  • Install R version 4.0.x or higher by following the instructions at http://www.r-project.org
  • From the R environment, install and load the "devtools" package
> install.packages("devtools")
> library(devtools)
  • Install the "invWishartSum" package from Github.com
> install_github("SampleSizeShop/invWishartSum")
  • Install the "mixedPower" package from Github.com
> install_github("SampleSizeShop/mixedPower")
  • Load the library
> library(mixedPower)
  • Run the simulation study. By default, data files and figures will be written to the current working directory. The study.data.dir and study.figures.dir arguments can be used to override the defaults. Empirical results require a SAS (v9.4) installation, with sas.exe available in the system PATH. The empirical results take several days to run, and so are turned off by default. A copy of the empirical results are included in the R package.
> runSimulationStudy(study.data.dir="myDataDir", study.figures.dir="myFiguresDir", study.runEmpirical=FALSE)
  • Run the applied example
> runLongitudinalExample(study.data.dir="myDataDir", study.figures.dir="myFiguresDir")

About

An R package providing power calculations for mixed models. The methods are validated in longitudinal and cluster randomized designs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published