Skip to contents

M^2 = (n - 1) * cor(u, v)^2 ~ chi^2_1 under independence, where (u, v) are row/column scores weighted by cell counts.

Usage

morie_ordered_categories(x, row_scores = NULL, col_scores = NULL)

Arguments

x

r x c contingency table.

row_scores

Length-r row scores; default 1..r.

col_scores

Length-c col scores; default 1..c.

Value

Named list: statistic (M^2), p_value, df, n, correlation.

Examples

morie_ordered_categories(x = rnorm(50))
#> $statistic
#> [1] NA
#> 
#> $p_value
#> [1] NA
#> 
#> $df
#> [1] 1
#> 
#> $n
#> [1] -8
#> 
#> $correlation
#> [1] NA
#> 
#> $method
#> [1] "Linear-by-linear association"
#>