Computes Cramer's V measure of association between two (possibly weighted) categorical variables

weighted.cramer(x, y, weights = NULL, na.rm = FALSE)

Arguments

x

the first categorical variable

y

the second categorical variable

weights

numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used.

na.rm

logical, indicating whether NA values should be silently removed before the computation proceeds.

Value

Numerical value with Cramer's V.

References

Rakotomalala R., 'Comprendre la taille d'effet (effect size)', http://eric.univ-lyon2.fr/~ricco/cours/slides/effect_size.pdf

Author

Nicolas Robette

See also

Examples

data(Movies)
weighted.cramer(Movies$Country, Movies$ArtHouse)
#> [1] 0.4691762