Skip to contents

Chi-squared test of independence

Usage

chi2_independence(contingency_table, correction = TRUE)

Arguments

contingency_table

A matrix or table of counts.

correction

Yates's continuity correction (2x2).

Value

An object of class "morie_test_result".

Examples

tab <- matrix(c(30, 20, 10, 40), 2, 2)
res <- chi2_independence(tab)
res$p_value
#> [1] 0.0001051636
res$extra$cramers_v
#> [1] 0.3878359