Re: [R] Help: chisq.test

From: Kjetil Brinchmann Halvorsen <kjetilbrinchmannhalvorsen_at_gmail.com>
Date: Sun 11 Dec 2005 - 12:53:27 EST

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))
>

This takes cbind(X,Y) as a contingency table,which is what you want.

> 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%

This is the same as chisq.test(table(X,Y)), which is the test on the contingency table

 > table(X,Y)

     Y
X 198 212 233 237 245

   25 0 0 0 0 1
   43 0 0 0 1 0
   48 0 1 0 0 0
   52 1 0 0 0 0
   57 0 0 1 0 0

which is not what you want.

Kjetil

>
>
> what is the difference between the two
>
> thanks
>
> bragadeesh
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Dec 11 13:00:30 2005

This archive was generated by hypermail 2.1.8 : Sun 11 Dec 2005 - 17:26:59 EST