
Pearson contingency coefficient C (Gibbons Ch 14.2.1)
Source:R/cntgc.R
morie_contingency_coefficient.RdC = sqrt(chi^2 / (chi^2 + n)). Also reports Cramer's V and the maximum attainable C = sqrt((min(r,c)-1)/min(r,c)).
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"
#>