This is a large update, including complete refactoring of underlying mechanisms related to how the package handles experimental designs and the addition of mean centering as well as p-value adjustment. The way study designs are defined has been changed in a major way, which also led to changes of other functions in the package to work correctly with the new functionality. As a result, the process of doing power analyses should now be more streamlined and intuitive as well as support a larger variety of research designs. The vignette has also been adapted to reflect these changes.
id parameter in define_design has been
removed. Grouping variables and hierarchical structures are now defined
entirely by a new sample_size parameter, providing a much
cleaner and more intuitive syntaxbetween parameter in define_design()
has been changed. Now, the predictor can directly reference the desired
analysis unit defined in sample_sizefixed_effects_from_average_outcome now has a new
function parameter center. It defaults to TRUE
and controls how the centering of predictors is handled. See function
documentation for more detailsn_is_total in power_sim has been
removed. This choice has been made obsolete by the new
sample_size parameter in define_designplot_sim_model function now also has a
center parameter that works identically to the one added in
power_simpower_sim (i.e. do not use
fixed_effects_from_average_outcome) and an interaction
effect is present in the formula, power_sim now stops
execution and alerts the user to explicitly choose if centering should
be appliedpower_sim when testing multiple effects for power
simultaneously. See function documentation for detailspower_sim function PowRPriori automatically
chooses either grand-mean centering or within-cluster centering
(between-subject predictors are centered on the grand mean,
within-subject predictors are centered on the cluster mean). See
function documentation and vignette for detailspower_sim has new parameters:
adjust_p_value, along and center
adjust_p_value controls the method of p-value
adjustment when multiple parameters are specified in
test_parameteralong defines which variable specified in the
sample_size parameter in define_design should
be incremented after each simulation course (defaults to
NULL, in which case the function increments the lowest
analysis unit)center controls if mean centering should be applied to
the predictors. Defaults to auto, in which case the
simulation engine tries to detect the appropriate centering method.create_design_matrix and implemented a new function
.center_predictors) to automatically and robustly handle
complex hierarchical and crossed designs, as well as automatic
mean-centeringn to plot_sim_model,
which allows the configuration of the sample size to be simulated for
the plot and defaults to the sample size of the lowest analysis level
otherwise.center_predictors which
handles the predictor mean centering.create_design_matrix was updated to
correctly handle the new objects created by
define_designplot_sim_model calculated the
wrong average sample value for the data when using
type="data"This a smaller update, improving the vignette and fixing a critical bug in the functions providing code snippets for model specification as well as some smaller bugs.
get_fixed_effects_structrue and
get_random_effects_structure so that the functions now
consistently produce the correct code snippetsplot_sim_model with
type = "data"type parameter in
the plot_sim_model function when using it with an
lme4-style formula objectpower_sim reached or exceeded
max_simulation_stepsn_issue_stop_prop proportion of models had fitting
issuespower_sim to include more
information when simulating a nested designpower_sim to incorporate the
percentage of model fits with issues in relation to the total number of
models fit