The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
pwranova
is an R package for power analysis in ANOVA
designs, including between-, within-, and mixed-factor designs, with
full support for both main effects and interactions across any
number of factors.
The package allows calculation of statistical power, required total sample size, significance level, and minimal detectable effect sizes expressed as partial eta squared or Cohen’s f for ANOVA terms and planned contrasts. In addition, complementary functions are included for common related tests such as t-tests and correlation tests, making the package a convenient toolkit for power analysis in experimental psychology and related fields.
You can install pwranova
from GitHub using
devtools
:
# Install devtools if not already installed
if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}
# Install pwranova
::install_github("mutopsy/pwranova") devtools
No heavy external dependencies are required for the core functionality.
library(pwranova)
### 1) Compute power (given N, effect size, alpha)
# One between factor (3 levels), no within factor
<- pwranova(
res_power_between nlevels_b = 3,
n_total = 60,
cohensf = 0.25,
alpha = 0.05
)
res_power_between
# One within factor (4 levels), no between factor
# (Optionally set epsilon for sphericity correction; default is 1)
<- pwranova(
res_power_within nlevels_w = 4,
n_total = 30,
cohensf = 0.50,
alpha = 0.05,
epsilon = 1.00
)
res_power_within
# Mixed design: one between factor (2 levels) and two within factors (2 and 3 levels)
# Show only a selected term with `target` if you want a compact output
<- pwranova(
res_power_mixed nlevels_b = 2,
nlevels_w = c(2, 3),
n_total = 30,
cohensf = 0.50,
alpha = 0.05,
epsilon = 1.00,
target = "B1:W2" # show only 2x3 interaction of the between factor and the second within factor
)
res_power_mixed
### 2) Solve required total N (given target power)
# One between factor (3 levels), no within factor
<- pwranova(
res_n_between nlevels_b = 3,
cohensf = 0.25,
alpha = 0.05,
power = 0.80
)# returns the smallest total N (multiple of groups) meeting the target power
res_n_between
### 3) Planned contrast power
# Contrast weights must sum to 0
<- pwrcontrast(
res_contrast weight = c(1, -1, 0), # three conditions, compare 1 vs 2
paired = FALSE,
n_total = 60,
cohensf = 0.25,
alpha = 0.05
) res_contrast
Current functions include:
pwranova()
— Power analysis for
between-/within-/mixed-factor ANOVA, covering all main effects and
interactions.pwrcontrast()
— Power analysis for a single planned
contrast (1 df) in between-subjects or paired/repeated-measures
designs.pwrttest()
— Power analysis for t-tests
(one-sample, paired, and two-sample).pwrcortest()
— Power analysis for Pearson’s correlation
(using either the t-distribution or Fisher’s
z-transformation approach).For full documentation, see the reference site (pkgdown): https://mutopsy.github.io/pwranova/reference/
Please cite the following preprint when using this package:
Muto, H. (2025). pwranova: An R package for power analysis of flexible ANOVA designs and related tests. Jxiv. https://doi.org/10.51094/jxiv.1555
See the Changelog: https://mutopsy.github.io/pwranova/news/
GPL-3
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.