Changelog
Source:NEWS.md
anovapowersim (development version)
- Added
sim_correction = c("auto", "GG", "none")to all simulation power functions. The default"auto"preserves existing behavior, while users can now prespecify corrected or uncorrected simulated tests. Uncorrected tests under nonsphericity warn that excess rejection reflects alpha inflation. - Fixed
power_n()andpower_n_calc()treatingn_startas an implicit lower bound when power at that value already met the target. Both searches now probe the smallest valid sample size and refine the resulting lower bracket before reportingn_needed. - Balanced simulation functions now issue a once-per-session message when a custom
means_patternis resolved, clarifying that its values are projected, normalized, and rescaled totarget_pes, unlike the literal means supplied throughcell_design(). Both documentation pages now cross-reference this semantic distinction. -
cell_design()now messages the count and exact factor-level combinations of cells created bydefault_nanddefault_m, making accidental factor levels visible instead of silently expanding the design. -
power_unbalanced()now warns when the deterministic reference data imply essentially zero partial eta squared for the tested term, pointing users to possible mean typos or a mismatchedterm. - Unbalanced within-subject designs now reject
:in level values and reject duplicate cell names produced by joining multi-factor levels with_, with errors that identify the problematic levels or colliding cells before any correlations are assigned. - Unbalanced power print and summary output now explain that simulated sample partial eta squared is upward-biased and that its mean, median, and interval are diagnostics rather than population/reference effects.
-
power_unbalanced()now warns whenss_type = "I"is used with unequal sample sizes, explains that sequential sums of squares are order-dependent, and reports the factor order inherited fromcell_design(). - Balanced simulation power functions now require custom covariance inputs to be created by
within_covariance()and reject raw matrices, eliminating ambiguous assumptions about within-cell row and column order. - Added
means_pattern()and an optionalmeans_patternargument topower_curve(),power_n(),power_achieved(),power_sensitivity(), anddesign_term_means(). Sparse relative cell values accept one-based indices or exact generated balanced-design level names, are broadcast over omitted factors, and are projected onto the requested ANOVA term before uniform calibration totarget_pes. - Balanced simulations now use a normalized centered-linear/Kronecker direction when no explicit pattern is supplied. Results record and print whether this documented default or a custom pattern was used.
- Balanced simulations now warn when an implicit default direction is consequential: the tested within-subject component has more than one degree of freedom and its population Greenhouse–Geisser epsilon is below one. Under nonsphericity,
power_simcan depend on mean direction even whentarget_pesand covariance are fixed. Calculation-only functions retain the conventional direction-insensitive noncentral-F approximation and do not warn;power_unbalanced()already receives literal means. - The
gpower = TRUEwarning is now issued whenevergpower = TRUEis used, not only for within-subject terms with more than one degree of freedom. G*Power’s estimates can differ fromtarget_pesmore broadly than that; the defaultgpower = FALSEremains recommended. -
power_n()now rejectsn_startvalues aboven_maxinstead of running the first simulation outside the requested search range. - Balanced simulation results now retain the full-precision simulated power used by adaptive searches and report valid/failed fit counts. Printed power values remain formatted to three decimals.
-
Breaking: simulation APIs now require one common marginal variance.
within_covariance()replacesdefault_sdwithsdand removes measurement-specificstandard_deviations; direct covariance matrices must have equal diagonal variances. For unbalanced designs, remove cell-levelsdanddefault_sdfromcell_design()and supply the common SD throughunbalanced_covariance(sd = ...). Unequal correlations and Greenhouse–Geisser correction remain supported. - Simulation functions now warn when an omitted covariance causes the common
sd = 1or within-subject correlation0.5defaults to be used. The covariance constructors warn whensdis omitted, and resolved covariance specifications warn whendefault_correlationfills unnamed pairs while preserving every explicitly supplied correlation. - Added the experimental, development-version-only
cell_design(),unbalanced_covariance(), andpower_unbalanced()functions for simulation-only power analysis of a fixed unbalanced allocation with user-defined cell means and sample sizes under a common standard deviation and optional within-subject correlations. Results include simulated power and partial eta-squared diagnostics, but deliberately omit calculated power. -
power_unbalanced()derives the population Greenhouse–Geisser epsilon from the covariance matrix shared across between-subject cells, reports it as$epsilon, and basespower_simon the Greenhouse–Geisser-corrected simulated p-value whenever that epsilon is below 1 (requiresss_type"III"or"II"; a warning is issued ifss_type = "I"is combined with a non-spherical design). -
Breaking (experimental):
cell_design()now takes awithinargument (character vector of within-subject factor names, orNULL) and stores it on the returned design;power_unbalanced()no longer acceptswithinand reads it from the design instead. Movewithin = ...frompower_unbalanced()intocell_design(). -
cell_design()gaineddefault_nanddefault_m. Supply both to auto-fill any missing cells in the complete factorial design; supplying only one is an error, and supplying neither requires every cell to be defined explicitly (as before). -
cell_design()now reports the exact missing factor-level combinations when a design is incomplete, instead of only a count, and errors clearly when a factor has fewer than two observed levels (previously this only surfaced later, insidepower_unbalanced(), with an unhelpful low-level contrast-fitting error). - The within-subject
n-consistency check (thatnis identical across all within-subject rows of the same between-subject cell) now runs incell_design()at construction time; it previously only surfaced insidepower_unbalanced(). - Added the experimental, development-version-only
power_achieved()function for simulation-based achieved-power estimation at a fixed sample size and partial eta squared. - Added the experimental, development-version-only
power_sensitivity()function for simulation-based minimum-detectable partial eta-squared searches at a fixed sample size and target power. - Added experimental, development-version-only
power_achieved_calc()andpower_sensitivity_calc()functions for equivalent fixed-sample analyses using calculated noncentral-F power without simulations. - Added
power_n_calc()for calculated-power, simulation-free sample-size searches in balanced ANOVA designs. - Added an
epsilonargument topower_n_calc()for calculated-power nonsphericity corrections on terms containing within-subject factors. - Added
within_covariance()and acovarianceargument forpower_n()andpower_curve()so simulations can use a custom common SD and within-subject correlation structure. These functions now derive a term-specific population Greenhouse–Geisser epsilon from that covariance and apply it to their calculated power. -
power_curve(),power_n(),power_achieved(),power_sensitivity(),power_n_calc(),power_achieved_calc(),power_sensitivity_calc(), anddesign_term_means()now warn whengpower = TRUEis combined with a term whose within-subject component has more than one degree of freedom (i.e. a within factor with more than two levels). In that casetarget_pesundergpower = TRUEdoes not equal the partial eta squared actually achieved – this mirrors a property of GPower’s own “as in Cohen (1988)” repeated-measures convention, which does not adjust for the number of measurements, rather than a bug in this package (gpower = TRUEremains an exact replica of GPower’s own noncentrality formula). Use the defaultgpower = FALSEwhentarget_pesshould match your reported or expected partial eta squared exactly. - When a supplied covariance yields a population Greenhouse–Geisser epsilon below 1,
power_curve(),power_n(),power_achieved(), andpower_sensitivity()now basepower_simon each simulated dataset’s Greenhouse–Geisser-corrected p-value instead of the uncorrected univariate test, sopower_simandpower_calcestimate the same corrected test rather than diverging under non-sphericity. This correction requiresss_type"III"or"II"; under"I", simulated p-values remain uncorrected, and these functions now warn whenss_type = "I"is combined with a covariance whose derived epsilon is below 1.
anovapowersim 1.1.0
CRAN release: 2026-05-31
- Added a tolerance argument to
power_n()for more precise control over the adaptive search.
anovapowersim 1.0.0
CRAN release: 2026-05-28
- First official release
- Fixed a bug where adaptive search for purely between-subjects designs would fail if the starting N was too small
anovapowersim 0.2.0
- Added parallel processing for simulation runs in
power_curve()andpower_n(). Useparallel = TRUEto enable parallel simulations andcoresto control the number of cores.