Prospective power analysis and design planning using the "plug-in" approach described by Piepho et al. (2022) <doi:10.1017/S0021859622000466> and Stroup, Ptukhina and Garai (2024) <doi:10.1201/9780429092060-24>. Expected treatment means and the proposed experimental design are encoded in an artificial data set, and a model is "fit" to it with random effect variances, correlations and residual dispersion fixed at user-specified values rather than being estimated. The resulting standard errors are used to compute the power of F-tests and user-defined contrasts, as well as Type S (sign) and Type M (magnitude) error rates (Gelman and Carlin, 2014 <doi:10.1177/1745691614551642>). Models are fit with 'glmmTMB', so the approach accommodates non-normal responses, heteroscedasticity, nested and crossed random effects, correlated random slopes, and structured covariances such as AR(1) and spatial correlation. Helper functions convert standard deviations and correlations into the internal parameterization of 'glmmTMB' and report the order in which random effect parameters must be supplied. Denominator degrees of freedom can be computed by the Kenward-Roger, residual or asymptotic methods (or can be specified by users), and contrasts are specified through 'emmeans'. Vignettes cover estimated marginal means, contrast specification, and worked examples for common agricultural designs.
| Version: | 0.7.1 |
| Depends: | R (≥ 4.1.0) |
| Imports: | dplyr, emmeans, glmmTMB (≥ 1.1.14), pbkrtest, reformulas, retrodesign, rlang |
| Suggests: | agridat, knitr, rmarkdown, testthat (≥ 3.0.0), tidyr |
| Published: | 2026-10-21 |
| DOI: | 10.32614/CRAN.package.powerutilities (may not be active yet) |
| Author: | Simon Riley |
| Maintainer: | Simon Riley <ssriley at protonmail.com> |
| BugReports: | https://github.com/SimonShamusRiley/powerutilities/issues |
| License: | BSD_3_clause + file LICENSE |
| URL: | https://github.com/SimonShamusRiley/powerutilities/tree/main |
| NeedsCompilation: | no |
| Materials: | README |
| CRAN checks: | powerutilities results |
| Package source: | powerutilities_0.7.1.tar.gz |
| Windows binaries: | r-devel: not available, r-release: not available, r-oldrel: not available |
| macOS binaries: | r-release (arm64): not available, r-oldrel (arm64): not available, r-release (x86_64): not available, r-oldrel (x86_64): not available |
Please use the canonical form https://CRAN.R-project.org/package=powerutilities to link to this page.