dat <- data.frame(x = c(1, 1, 2, 1, 3, 3, 2, 2, 1, 2),
y = c(3, 2, 3, 1, 2, 4, 1, 2, 3, 4),
z = c(2, 2, 2, 1, 2, 2, 1, 2, 1, 2))
# Contingency coefficient between x and y
cor.cont(dat[, c("x", "y")])
# Adjusted contingency coefficient between x and y
cor.cont(dat[, c("x", "y")], adjust = TRUE)
# Contingency coefficient matrix between x, y, and z
cor.cont(dat)
# Adjusted contingency coefficient matrix between x, y, and z
cor.cont(dat, adjust = TRUE)
Run the code above in your browser using DataLab