Simulation function used to estimate power

ANOVA_power(
  design_result,
  alpha_level = Superpower_options("alpha_level"),
  correction = Superpower_options("correction"),
  p_adjust = "none",
  nsims = 1000,
  seed = NULL,
  verbose = Superpower_options("verbose"),
  emm = Superpower_options("emm"),
  emm_model = Superpower_options("emm_model"),
  contrast_type = Superpower_options("contrast_type"),
  emm_p_adjust = "none",
  emm_comp = NULL
)

Arguments

design_result

Output from the ANOVA_design function

alpha_level

Alpha level used to determine statistical significance

correction

Set a correction of violations of sphericity. This can be set to "none", "GG" Greenhouse-Geisser, and "HF" Huynh-Feldt

p_adjust

Correction for multiple comparisons. This will adjust p values for ANOVA/MANOVA level effects; see ?p.adjust for options

nsims

number of simulations to perform

seed

Set seed for reproducible results

verbose

Set to FALSE to not print results (default = TRUE)

emm

Set to FALSE to not perform analysis of estimated marginal means

emm_model

Set model type ("multivariate", or "univariate") for estimated marginal means

contrast_type

Select the type of comparison for the estimated marginal means. Default is pairwise. See ?emmeans::`contrast-methods` for more details on acceptable methods.

emm_p_adjust

Correction for multiple comparisons; default is "none". See ?summary.emmGrid for more details on acceptable methods.

emm_comp

Set the comparisons for estimated marginal means comparisons. This is a factor name (a), combination of factor names (a+b), or for simple effects a | sign is needed (a|b)

Value

Returns dataframe with simulation data (p-values and effect sizes), anova results (type 3 sums of squares) and simple effect results, and plots of p-value distribution.

"sim_data"

Output from every iteration of the simulation

"main_result"

The power analysis results for ANOVA effects.

"pc_results"

The power analysis results for pairwise comparisons.

"manova_results"

Default is "NULL". If a within-subjects factor is included, then the power of the multivariate (i.e. MANOVA) analyses will be provided.

"emm_results"

The power analysis results of the estimated marginal means.

"plot1"

Distribution of p-values from the ANOVA results.

"plot2"

Distribution of p-values from the pairwise comparisons results.

"correction"

The correction for sphericity applied to the simulation results.

"p_adjust"

The p-value adjustment applied to the simulation results for ANOVA/MANOVA omnibus tests and t-tests.

"emm_p_adjust"

The p-value adjustment applied to the simulation results for the estimated marginal means.

"nsims"

The number of simulations run.

"alpha_level"

The alpha level, significance cut-off, used for the power analysis.

"method"

Record of the function used to produce the simulation

References

too be added

Examples

if (FALSE) {
## Set up a within design with 2 factors, each with 2 levels,
## with correlation between observations of 0.8,
## 40 participants (who do all conditions), and standard deviation of 2
## with a mean pattern of 1, 0, 1, 0, conditions labeled 'condition' and
## 'voice', with names for levels of "cheerful", "sad", amd "human", "robot"
design_result <- ANOVA_design(design = "2w*2w", n = 40, mu = c(1, 0, 1, 0),
      sd = 2, r = 0.8, labelnames = c("condition", "cheerful",
      "sad", "voice", "human", "robot"))
power_result <- ANOVA_power(design_result, alpha_level = 0.05,
      p_adjust = "none", seed = 2019, nsims = 10)
      }