两个chisquare testing比较

m
microsat
楼主 (北美华人网)
两个矩阵 A B C D E F
a b c d e f
每个矩阵都能产生一个chisquare testing。有什么方法能比较这两个chisquare testing,看是否有差异?

c
computer101
你这是要做diff of diff? 直接比较两个chi-square testing比较难,你需要证明俩testing statistic的差服从某个分布才能test。抱歉离开学校太久了,具体俩Chi-square test statistic的差是个什么分布现在已经推不出来了。我感觉你不如对 (A-D, B-E, C-F) 和 (a-d, b-e, c-f) 这俩vector去做一个chi-square test,看看diff of diff是不是趋于0.
m
microsat
你这是要做diff of diff? 直接比较两个chi-square testing比较难,你需要证明俩testing statistic的差服从某个分布才能test。抱歉离开学校太久了,具体俩Chi-square test statistic的差是个什么分布现在已经推不出来了。我感觉你不如对 (A-D, B-E, C-F) 和 (a-d, b-e, c-f) 这俩vector去做一个chi-square test,看看diff of diff是不是趋于0.
computer101 发表于 2023-03-02 20:07

多谢!
H
Hershel
可以试试Cochran–Mantel–Haenszel test,相当于一个stratified chisq test。然后再用Breslow-Day test来比较不同的strata是否有显著差异。 也可以直接logistic regression
m
microsat
可以试试Cochran–Mantel–Haenszel test,相当于一个stratified chisq test。然后再用Breslow-Day test来比较不同的strata是否有显著差异。 也可以直接logistic regression

Hershel 发表于 2023-03-03 10:07

请问如何直接logistic regression呢?我对这个感兴趣。
假设chisquare test的行变量是x,列变量是y,那么x和y都是categorical 变量。
对于第一个chisquare test test1 = glm(y~x, data=data1) 对于第二个chisquare test test2 = glm(y~x, data=data2)
然后怎么比较test1和test2?
H
Hershel
请问如何直接logistic regression呢?我对这个感兴趣。
假设chisquare test的行变量是x,列变量是y,那么x和y都是categorical 变量。
对于第一个chisquare test test1 = glm(y~x, data=data1) 对于第二个chisquare test test2 = glm(y~x, data=data2)
然后怎么比较test1和test2?
microsat 发表于 2023-03-03 10:23

你直接rbind data1和data2,新建一列z来标记来自哪个dataset,然后test=glm(y~x+z+x*z,data=combine),最后看z和x*z的coefficient上的p- value就行了