APA Descriptive Statistics Table for Between-Groups ANOVA

Description

Creates an APA-formatted descriptive statistics table for between-groups ANOVA designs, showing mean and SD for each group. Compatible with output from bg_anova_answers(), anova_kgroup_answers(), and anova_factorial_answers().

Usage

create_bg_anova_table(
  anova_results_list = NULL,
  iv_name = "Independent Variable",
  dv_name = "Dependent Variable",
  group_labels = NULL,
  KEY = TRUE,
  table_title = NULL,
  table_number = NULL
)

Arguments

anova_results_list Output from bg_anova_answers(), anova_kgroup_answers(), or anova_factorial_answers(). Can be NULL for a blank table template.
iv_name Character. Display name for the independent variable.
dv_name Character. Display name for the dependent variable.
group_labels Character vector or NULL. Display labels for groups. If NULL and KEY = TRUE, labels are extracted from the results. If NULL and KEY = FALSE, defaults to "Group 1", "Group 2", "Group 3".
KEY Logical. If TRUE (default), fill with computed values. If FALSE, create a blank template.
table_title Character or NULL. Optional table caption.
table_number Integer or NULL. Optional table number.

Value

A flextable::flextable() object.

Examples

library("psych350lab")

# Two-group design (bg_anova_answers)
data(superman, package = "psych350data")
result_2g <- bg_anova_answers(superman, iv = "clark_grp", dv = "rt_critics_score")
create_bg_anova_table(result_2g,
  iv_name = "Height Group", dv_name = "Critics Score",
  group_labels = c("Under 6ft", "6ft+"))

Height Group

Critics Score

Under 6ft

6ft+

Mean

76.83

87.00

Standard Deviation

11.13

1.41

# Blank template
create_bg_anova_table(NULL,
  iv_name = "Condition", dv_name = "Score",
  group_labels = c("Low", "Medium", "High"),
  KEY = FALSE)

Condition

Score

Low

Medium

High

Mean

Standard Deviation