Skip to contents

Make contingency table with chi-square test of independence

Usage

apa_chisq(
  x,
  note = NULL,
  family = "Times New Roman",
  font_size = 12,
  text_color = "black",
  line_spacing = 2,
  border_color = "black",
  border_width = 0.5,
  suppress_warnings = TRUE
)

Arguments

x

A two-column data.frame or tibble

note

Custom note (overrides automatic note.)

family

font family

font_size

font size

text_color

text color

line_spacing

spacing between lines

border_color

border color

border_width

border width in pixels

suppress_warnings

Suppress any warnings if true.

Value

flextable

Examples

apa_chisq(mtcars[, c("am", "gear")])
#> Registered S3 method overwritten by 'ftExtra':
#>   method                  from     
#>   as_flextable.data.frame flextable

am

gear

0

1

n

%

n

%

3

15

78.9%

0

0.0%

4

4

21.1%

8

61.5%

5

0

0.0%

5

38.5%

Note. χ2 (2) = 20.94, p < .001, Adj. Cramer’s V = .78