APA Write-Up for 2x2 Between-Groups Factorial ANOVA

Description

Generates an APA-style paragraph for a two-way between-groups ANOVA, reporting interaction and main effects with hypothesis evaluation.

Usage

apa_2x2_bg_factorial_writeup(
  factorial_results_list,
  dv_name,
  factor_a_name,
  factor_b_name,
  factor_a_labels,
  factor_b_labels,
  hypothesis = NULL,
  alpha = 0.05,
  report_main_effects = TRUE
)

Arguments

factorial_results_list

Output from factorial ANOVA containing:

Interaction
List with F, p_value, df_effect, df_error, mse
MainEffect_A
List for factor A
MainEffect_B
List for factor B
CellDescriptives
Data frame with factor_a, factor_b, mean, sd, n
MarginalMeans_A
Data frame with level, mean, se or sd
MarginalMeans_B
Data frame with level, mean, se or sd
SimpleEffects
Optional. List of simple effect results
dv_name Character. Descriptive name for DV.
factor_a_name Character. Descriptive name for factor A.
factor_b_name Character. Descriptive name for factor B.
factor_a_labels Character vector of length 2. Labels for factor A levels.
factor_b_labels Character vector of length 2. Labels for factor B levels.
hypothesis

List with hypothesis details:

interaction_rh
Full RH statement for interaction.
simple_effects
List of expected simple effects
main_a_direction
Expected main effect direction for A
main_b_direction
Expected main effect direction for B
alpha Significance level. Default 0.05.
report_main_effects Logical. Report main effects. Default TRUE.

Value

A character string with APA write-up.

See Also

reshape_to_bg_factorial() to convert anova_factorial_answers() output to the format expected by this function.

Examples

library("psych350lab")

writeup <- apa_2x2_bg_factorial_writeup(
  results,
  dv_name = "importance ratings",
  factor_a_name = "gender",
  factor_b_name = "party",
  factor_a_labels = c("female", "male"),
  factor_b_labels = c("prosecution", "defense"),
  hypothesis = list(
    interaction_rh = "the effect of party will depend on gender",
    simple_effects = list(
      list(at_level = "female", direction = "b1_higher"),
      list(at_level = "male", direction = "b2_higher")
    )
  )
)