"My Coyne" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> I received the following warning when running chi-square;
>
> n Is there a way to catch the 'error' code of 'warning' after run
> chisq.test(x)?
It is not an error message. It is a warning message. When I assign the
result of chisq.test(.) to an object and then look at its structure
with str(), I do not see the warning message "in there". Instead the
message appears on the console. When you look at the chisq.test
function itself you see that any "E" less than 5 will trigger the
warning:
if (any(E < 5) && is.finite(PARAMETER))
warning("Chi-squared approximation may be incorrect")
You should be able to check the <object>$expected matrix in a similar
manner if you goal is to process a large number of tables
programatically.
>
> n What does this error mean?
See above. Consider invoking chisq.test with the simulate.p.value
option.
--
David Winsemius
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.