如何在R中进行卡方独立性检验?

您可以使用chisq.test ()函数执行独立性卡方检验给出列联表作为x参数的矩阵。例如:

M =矩阵(数据= c(89, 84, 86, 9, 8, 24), nrow = 3, ncol = 2)

chisq。te年代t(x= m)