Cramer’s V returns the same measure of association regardless of ordering of labels, where 1 is perfect association. Using Jennie’s example, notice both equal 0:
library(DescTools) # for CramerV() function
X <- c(rep("A", 3), rep("B", 3))
Y <- c(rep("X", 3), rep("Y", 3))
t1 <- table(X, Y)
t1
## Y
## X X Y
## A 3 0
## B 0 3
Y <- c(rep("Y", 3), rep("X", 3))
t2 <- table(X, Y)
t2
## Y
## X X Y
## A 0 3
## B 3 0
CramerV(t1)
## [1] 1
CramerV(t2)
## [1] 1
There is no hypothesis test associated with Cramer’s V, however you can calculate confidence intervals using four different methods. I couldn’t immediately tell you why you should choose one over the other, though the fisher methods do seem to provide a little tighter upper bound for small samples.
X <- c(rep("A", 10), rep("B", 10))
Y <- c(rep("Y", 9), rep("X", 8), "X", "Y", "Y")
t3 <- table(X, Y)
t3
## Y
## X X Y
## A 1 9
## B 8 2
CramerV(t3, conf.level = 0.95) # "ncchisq" (default)
## Cramer V lwr.ci upr.ci
## 0.7035265 0.2652604 1.0000000
CramerV(t3, conf.level = 0.95, method = "ncchisqadj")
## Cramer V lwr.ci upr.ci
## 0.7035265 0.3469338 1.0000000
CramerV(t3, conf.level = 0.95, method = "fisher")
## Cramer V lwr.ci upr.ci
## 0.7035265 0.3789969 0.8739612
CramerV(t3, conf.level = 0.95, method = "fisheradj")
## Cramer V lwr.ci upr.ci
## 0.7035265 0.3947392 0.8782639