MyNixOS website logo
Description

Simple Power Simulations for ANOVAs.

A-priori power simulations and power-calculations for within, between and mixed ANOVAs based on target (partial) eta-squared values. Supports complex designs with more than two factors and their interactions with a single function call.

anovapowersim

anovapowersim is designed to make determining a priori power for ANOVAs as easy as possible. You can add as many within/between factors with as many levels as you would like. There's no need to estimate condition means, SDs, or repeated-measures correlations; just enter the target partial eta squared.

The package simulates data and estimates power based on the specified design. It also provides direct power calculations for comparison.

Getting a priori power for a 2 × 2 × 3 mixed interaction effect is as simple as running the following:

library(anovapowersim)

power_n(
  between = c(group = 2), # group has 2 levels
  within = c(stim = 2, cond = 3), # stim has 2 levels, cond has 3
  term = "group:stim:cond", # three-way interaction term
  target_pes = 0.08, # target effect size
  n_sims = 5000, # increase to 10000+ for more precise estimates
  power = .90,
  alpha = .05,
  parallel = TRUE, # simulations will be run in parallel for speed
  seed = 123 # for reproducibility
)
#><anovapowersim_curve>
#>  term:          'group:stim:cond'
#>  target power:  0.900
#>  alpha:         0.05
#>  effect size:   pes = 0.08
#>  n values:      8 per-cell sample sizes visited
#>  sims per cell size: 5000
#>  SS type:       III
#>  n needed for between-subjects cell: 38
#>  total N needed: 76
#>
#> n_per_cell total_n n_sims num_df den_df    ncp power_calc power_sim
#>         31      62   5000      2    120 10.435      0.823     0.825
#>         37      74   5000      2    144 12.522      0.890     0.885
#>         38      76   5000      2    148 12.870      0.899     0.903
#>         39      78   5000      2    152 13.217      0.907     0.901
#>         40      80   5000      2    156 13.565      0.915     0.918
#>         41      82   5000      2    160 13.913      0.922     0.916
#>         46      92   5000      2    180 15.652      0.949     0.947
#>         62     124   5000      2    244 21.217      0.989     0.988

Installation

anovapowersim is currently in development. You can install it from GitHub using the devtools package:

# Install devtools if you haven't already
install.packages("devtools")

# Install anovapowersim from GitHub
devtools::install_github("shaheedazaad/anovapowersim")

Citation

A preprint is in preparation.

Limitations

anovapowersim is designed to be simple and easy to use first, which means it has some limitations for now. It does not support:

  • Covariates (ANCOVAs)
  • Means-based simulations for unbalanced designs
  • Nonsphericity corrections (though this might change)
  • Specific interaction shapes (based on means)
  • Simple main effects/pairwise comparisons

Other packages

I recommend checking out Superpower, which handles some of the limitations above.

Metadata

Version

1.1.0

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows