[R] chi-squared test

John Fox jfox at mcmaster.ca
Tue Dec 18 13:13:12 CET 2001


Dear Juli,

As the output from chisq.test (and the help for this function) indicates, 
chisq.test by default applies a Yates continuity correction. Using 
chisq.test(aa, bb, correct=F) produces the same result as the summary 
function for table objects.

John

At 09:41 AM 12/18/2001 +0000, juli g. pausas wrote:
>I don't quite understand the difference between the two methods for
>performing a chi-squared test on contingency tables:  summary(table())
>and   chisq.test()
>They may different results. E.g.:
>
>aa <- gl(2, 10)
>bb <- as.factor(c(1,2,2,2,1,2,1,2,2,2,1,2,2,2,1,1,1,2,1,1))
>aa <- c(aa, aa)
>bb <- c(bb, bb)
>table(aa, bb)
>summary(table(aa, bb))
>chisq.test(aa, bb)
>
>Could somebody give me some clues?
>Thanks in advance

-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list