APA Descriptive Statistics Table for Within-Groups ANOVA

Description

Creates an APA-formatted descriptive statistics table for a repeated measures ANOVA, showing mean, SD, and n for each condition. Can be filled (answer KEY) or blank (student worksheet).

Usage

create_wg_anova_table(
  anova_results_list = NULL,
  dv_name = "Dependent Variable",
  condition_labels = NULL,
  KEY = TRUE,
  table_title = NULL
)

Arguments

anova_results_list Output from wg_anova_answers() or NULL (for blank table).
dv_name Character. Display name for the dependent variable. Used as the row header label.
condition_labels Character vector or NULL. Display labels for conditions. If NULL and KEY = TRUE, uses condition names from results. If NULL and KEY = FALSE, defaults to "Condition 1", "Condition 2".
KEY Logical. If TRUE (default), fill with computed values. If FALSE, create a blank template.
table_title Character or NULL. Optional table caption.

Value

A flextable::flextable() object.

Examples

library("psych350lab")

data(superman, package = "psych350data")
result <- wg_anova_answers(superman,
  dv1 = "rt_critics_score", dv2 = "rt_audience_score")

# Filled table
ft <- create_wg_anova_table(result,
  dv_name = "Rating",
  condition_labels = c("Critics Score", "Audience Score"),
  table_title = "Table 1. Descriptive Statistics for Ratings")
ft

Rating

M

SD

n

Critics Score

79.38

10.53

8

Audience Score

80.38

10.53

8

# Blank table
ft_blank <- create_wg_anova_table(NULL,
  dv_name = "Rating",
  condition_labels = c("Critics Score", "Audience Score"),
  KEY = FALSE)
ft_blank

Rating

M

SD

n

Critics Score

Audience Score