dat <- data.frame(x = c(1, 1, 2, 1, 3, 3, 2, 2, 1, 2),
y = c(1, 2, 2, 1, 3, 4, 1, 2, 3, 1),
z = c(1, 1, 2, 1, 2, 3, 1, 2, 3, 2))
# Bias-corrected Cramer's V between x and y
cor.cramer(dat[, c("x", "y")])
# Cramer's V between x and y
cor.cramer(dat[, c("x", "y")], correct = FALSE)
# Bias-corrected Cramer's V matrix between x, y, and z
cor.cramer(dat[, c("x", "y", "z")])
# Cramer's V matrix between x, y, and z
cor.cramer(dat[, c("x", "y", "z")], correct = FALSE)
Run the code above in your browser using DataLab