Skip to contents

C = sqrt(chi^2 / (chi^2 + n)). Also reports Cramer's V and the maximum attainable C = sqrt((min(r,c)-1)/min(r,c)).

Usage

morie_contingency_coefficient(x)

Arguments

x

A 2-D contingency table of counts.

Value

Named list: statistic (C), cramers_v, chi2, p_value, df, max_C, n.

Examples

set.seed(1)
morie_contingency_coefficient(x = matrix(sample(1:5, 50, TRUE), 10, 5))
#> $statistic
#> [1] 0.4243801
#> 
#> $cramers_v
#> [1] 0.2343388
#> 
#> $chi2
#> [1] 30.31289
#> 
#> $p_value
#> [1] 0.7354673
#> 
#> $df
#> [1] 36
#> 
#> $max_C
#> [1] 0.8944272
#> 
#> $n
#> [1] 138
#> 
#> $method
#> [1] "Pearson contingency coefficient"
#>