[R] Why two chisq.test p values differ when the contingency table is transposed?

Tao Shi shitao at hotmail.com
Tue Jul 15 21:18:59 CEST 2003


I'm using R1.7.0 runing with Win XP.  Thanks,

...Tao


????????????????????????????????????????????????????????

>x
     [,1] [,2]
[1,]  149  151
[2,]    1    8
>t(x)
     [,1] [,2]
[1,]  149    1
[2,]  151    8
>chisq.test(x, simulate.p.value=T, B=100000)

        Pearson's Chi-squared test with simulated p-value (based on 1e+05 
replicates)

data:  x
X-squared = 5.2001, df = NA, p-value = 0.03774

>chisq.test(t(x), simulate.p.value=T, B=100000)

        Pearson's Chi-squared test with simulated p-value (based on 1e+05 
replicates)

data:  t(x)
X-squared = 5.2001, df = NA, p-value = 0.01642




More information about the R-help mailing list