[R] Help: chisq.test

J Dougherty jwd at surewest.net
Sun Dec 11 05:23:03 CET 2005


On Saturday 10 December 2005 17:37, Thanjavur Bragadeesh wrote:
> I have two groups of patients (improved or not improved) named x and y
> group respectively after being treated with 5 different drugs
>
> X<-c(43,52,25,48,57) and
>
> Y<-c(237,198,245,212,233)
>
> when I run
>
> chisq.test(cbind(x,y))

X and Y here are read as two columns of data when you use cbind with five 
rows.  With cbind you have 4 DOF.
>
> I get a p value of <0.0024
>
> but if I run
>
> chisq.test(x,y)   I get a p value of 0.22 not significant at 5%

When not using cbind, you have 16 DOF.  The numbers may look the same to you, 
but you are specifying two quite different sets of data,
>
>
> what is the difference between the two
>
> thanks
>
> bragadeesh

JWDougherty




More information about the R-help mailing list