Skip to contents

Thin extender over DescTools::CramerV for the symmetric association statistic between two categorical variables.

Usage

morie_desc_cramers_v(x, y = NULL, ...)

Arguments

x

A factor, character vector, or contingency table.

y

Optional second categorical vector when x is not already a contingency table.

...

Further arguments forwarded to DescTools::CramerV (e.g. conf.level).

Value

A list with $method = "DescTools::CramerV" and $raw (the upstream numeric or matrix).

Examples

if (requireNamespace("DescTools", quietly = TRUE)) {
  set.seed(1)
  x <- sample(c("a", "b"), 60, TRUE); y <- sample(c("u", "v"), 60, TRUE)
  morie_desc_cramers_v(table(x, y))
}
#> $method
#> [1] "DescTools::CramerV"
#> 
#> $raw
#> [1] 0.03119782
#>