# frequency table for two groups, each choosing from three options
condition1 <- c(30, 20, 50)
condition2 <- c(35, 30, 35)
X <- cbind(condition1, condition2)
rownames(X) <- c("choice1", "choice2", "choice3")
# chi-square test of association
chisq.test(X)
# effect size estimate
cramersV(X)
Run the code above in your browser using DataLab