Factorial (Two-Way) ANOVA

Description

Performs a 2x2 factorial ANOVA using the jmv package, returning main effects, interaction, estimated marginal means, descriptive statistics for all cells, and LSD/HSD post-hoc values. All numeric values stored unrounded.

Usage

anova_factorial_answers(
  data,
  dv,
  iv1,
  iv2,
  iv1_labels = NULL,
  iv2_labels = NULL,
  iv1_levels = NULL,
  iv2_levels = NULL,
  interaction_label = NULL
)

Arguments

data A data frame or tibble.
dv Character string. Name of the dependent variable.
iv1 Character string. Name of the first independent variable.
iv2 Character string. Name of the second independent variable.
iv1_labels Character vector. Labels for levels of IV1.
iv2_labels Character vector. Labels for levels of IV2.
iv1_levels Numeric or character vector. Explicit ordering of IV1 levels.
iv2_levels Numeric or character vector. Explicit ordering of IV2 levels.
interaction_label Character string. Optional label for the interaction.

Value

A list with elements (all numeric values unrounded).

Examples

library("psych350lab")

library(psych350data)
# Between-groups factorial ANOVA: clark_grp x tomatometer predicting rt_critics_score
bg_results <- anova_factorial_answers(
  data = superman,
  dv = "rt_critics_score",
  iv1 = "clark_grp",
  iv2 = "tomatometer",
  iv1_labels = c("Under 6ft", "6ft or taller"),
  iv2_labels = c("Rotten", "Fresh")
)