#0. sample data
#1. chi square test
#2. chi square calculator, very very easy
#0. sample data
data <- data.frame(
index = seq(1, 100,by=1),
color = sample(c("R","G","B"), 100, replace = TRUE),
group = sample(c("a","b"), 100, replace = TRUE)
)
summary(data)
(table <- table(data$color, data$group))
#1. chi square test and proportion test
chisq.test(x=data$group, y=data$color)
chisq.test(table)
prop.test(table, correct = F)
#2. chi square calculator, very very easy
ref : https://www.socscistatistics.com/tests/chisquare2/default2.aspx