An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101229/e19b0022/attachment.pl>
Problem applying Chi-square in R and Cochran's Recommendations
2 messages · Manoj Aravind, Johannes Hüsing
Manoj Aravind <aravindbm at gmail.com> [Wed, Dec 29, 2010 at 03:59:16PM CET]:
Sir, I have a problem here while applying chisquare test to the following Data ( below the subject of this mail) ...when I wanted to test the significance using three different free statistical packages, here R, EpiInfo and OpenEpi. *Only OpenEpi accepts the test based on Cochran's Recommendations. * R says " chi squared approximation may be incorrect." Does it mean the same as what EpInfo saying " Chi square is not valid"
Yes. Take confidence from the fact that arithmetically all three programs arrive at the same result (anything but surprising). The recommendations when to trust Chi-Square are similar. R lets you look at the source though, so if you type
chisq.test
you get a result containing the following lines:
sr <- rowSums(x)
sc <- colSums(x)
E <- outer(sr, sc, "*")/n
(so E contains the expected values for the cell entries)
and
names(PARAMETER) <- "df"
if (any(E < 5) && is.finite(PARAMETER))
warning("Chi-squared approximation may be incorrect")
so it seems that R is fussier about the quality of the approximation
than EpiInfo:
[...]
------------------------------ Chi Square=43.81Degrees of Freedom=2p-value= <0.0000001 Cochran recommends accepting the chi square if: 1. No more than 20% of cells have expected < 5.2. No cell has an expected value < 1. In this table: 17% of 6 cells have expected values < 5.No cells have expected values < 1. *Using these criteria, this chi square can be accepted.* Expected value = row total*column total/grand total Rosner, B. Fundamentals of Biostatistics. 5th ed. Duxbury Thompson Learning. 2000; p. 395
Note that these are recommendations which you are free to heed or ignore.
Johannes H?sing There is something fascinating about science.
One gets such wholesale returns of conjecture
mailto:johannes at huesing.name from such a trifling investment of fact.
http://derwisch.wikidot.com (Mark Twain, "Life on the Mississippi")