Power Analysis with Superpower
This book is still being developed. If you have any comments to improve this book, let us know.
This book was compiled with R version 4.0.3 (2020-10-10).
The goal of
Superpower is to easily simulate factorial designs and empirically calculate power using a simulation approach.
The R package is intended to be utilized for prospective (a priori) power analysis. Calculating post hoc power is not a useful thing to do for single studies.
This package, and book, expect readers to have some familiarity with R (2020). However, we have created two Shiny apps (for the
ANOVA_exact functions respectively) to help use
Superpower if you are not familiar with R. Reading through the examples in this book, and reproducing them in the Shiny apps, is probably the easiest way to get started with power analyses in Superpower.
In this book we will display a variety of ways the
Superpower package can be used for power analysis and sample size planning for factorial experimental designs. We also included various examples of the performance of
Superpower against other R packages (e.g.,
pwr2ppl by Aberson (2020) and
pwr by Champely (2020)) and statistical programs (such as G*Power Faul et al. (2007), MOREpower Campbell and Thompson (2012), and SAS’s
PROC GLMPOWER (2015)). All uses of the
ANOVA_power function have been run with 10000 iterations (
nsims = 10000). If you have any issues using
Superpower or want to expand its capabilities please raise the issue on our GitHub repository. Issues with the book, should be raised on the book’s repository.
ARC and DL wrote the majority of this book together when creating the
Superpower R package. Initially, these were meant to be validation documents to show that Superpower worked as intended, but later decided to convert this into a teaching tool. CMPP was hired in 2019 to aide in compiling this book and was instrumental in editing/fact checking early versions of the book. GP wrote the majority of the first chapter as part of a instructional manual to his students and was kind enough to share a version to be included in this book. FA, creator of the
emmeans_power function in
Superpower, wrote an early version of the
emmeans chapter which serves as the vignette in the package.
This work was funded by VIDI Grant 452-17-013 from the Netherlands Organisation for Scientific Research.
The following packages and settings are necessary to reproduce the output in this package.
<- 10000 nsims library(mvtnorm) library(MASS) library(afex) library(emmeans) library(gridExtra) library(reshape2) library(pwr) library(pwr2ppl) library(lsr) library(viridis) library(broom) library(car) library(tidyverse) library(Superpower) library(knitr) library(kableExtra) library(MBESS) library(grid) library(GGally) library(scales) library(here) library(data.table)