[R] Pearson chi-square test

2011-09-27 Thread Michael Haenlein
Dear all, I have some trouble understanding the chisq.test function. Take the following example: set.seed(1) A - cut(runif(100),c(0.0, 0.35, 0.50, 0.65, 1.00), labels=FALSE) B - cut(runif(100),c(0.0, 0.25, 0.40, 0.75, 1.00), labels=FALSE) C - cut(runif(100),c(0.0, 0.25, 0.50, 0.80, 1.00),

Re: [R] Pearson chi-square test

2011-09-27 Thread Meyners, Michael
: Tuesday, September 27, 2011 12:45 To: r-help@r-project.org Subject: [R] Pearson chi-square test Dear all, I have some trouble understanding the chisq.test function. Take the following example: set.seed(1) A - cut(runif(100),c(0.0, 0.35, 0.50, 0.65, 1.00), labels=FALSE) B - cut(runif(100),c

Re: [R] Pearson chi-square test

2011-09-27 Thread Meyners, Michael
Sent: Tuesday, September 27, 2011 13:28 To: Michael Haenlein; r-help@r-project.org Subject: Re: [R] Pearson chi-square test Not sure what you want to test here with two matrices, but reading the manual helps here as well: y a vector; ignored if x is a matrix. x and y are matrices

Re: [R] Pearson chi-square test

2011-09-27 Thread Michael Haenlein
To: Michael Haenlein; r-help@r-project.org Subject: RE: [R] Pearson chi-square test Just for completeness: the manual calculation you'd want is most likely sum((x-y)^2 / (x+y)) (that's one you can find on the Wikipedia link you provided). To get the same from chisq.test, try something

Re: [R] Pearson chi-square test

2011-09-27 Thread Meyners, Michael
-project.org Cc: Meyners, Michael Subject: RE: [R] Pearson chi-square test Dear Michael,   Thanks very much for your answers!   The purpose of my analysis is to test whether the contingency table x is different from the contingency table y. Or, to put it differently, whether there is a significant difference