Package: powerutilities
Title: Power Analysis for Linear and Generalized Linear Mixed Models
Description: 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
Authors@R: 
    person("Simon", "Riley", email = "ssriley@protonmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-4833-2026"))
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
License: BSD_3_clause + file LICENSE
URL: https://github.com/SimonShamusRiley/powerutilities/tree/main
BugReports: https://github.com/SimonShamusRiley/powerutilities/issues
Encoding: UTF-8
VignetteBuilder: knitr
LazyData: true
Config/roxygen2/version: 8.1.0
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-10-13 07:40:02 UTC; Simon
Author: Simon Riley [aut, cre] (ORCID: <https://orcid.org/0000-0002-4833-2026>)
Maintainer: Simon Riley <ssriley@protonmail.com>
Repository: CRAN
Date/Publication: 2026-10-21 17:50:09 UTC
