[R] fisher.test - can I use non-integer expected values?

David Winsemius dwinsemius at comcast.net
Wed Dec 11 05:21:57 CET 2013


On Dec 10, 2013, at 6:55 PM, bakerwl wrote:

> David,
> 
> Thanks for your reply--I appreciate your thoughts. I will look at prop.test.
> 
> The reason I chose fisher.test over chisq.test is that fisher.test is more
> appropriate when observed counts are not numerous--empty cells and cells
> with counts < 5 are less a problem. 
> 
> Expected values are needed to test a null hypothesis against observed
> counts, but if total observed counts are 20 for 3 categories, then a null
> hypothesis of a random effect would use expected values = 6.67 in each of
> the 3 categories (20/3). 
> 
> Yes, fisher.test is for count data and so is chisq.test, but chisq.test
> allows 6.67 to be input as expected values in each of 3 categories, while
> fisher.test does not seem to allow this? 
> 
> I don't think it is inherent in Fisher's exact test itself that expected
> values must be integers, but not sure.

I see it differently, although I could be further educated on the subject and I've been wrong on Rhelp before. I think it _is_ inherent in Fisher's Exact Test. FET is essentially a permutation test built on the hypergeometric distribution (a discrete distribution)  and it is unclear what to do with 1.33 of an entity under conditions of permutation.

The "chi-square test" (one of many so-called chi-square tests) is a pretty good approximation to the discrete counterparts despite the fact that the chi-square distribution takes continuous arguments and generally holds well down to expected counts of 5. The link between the chi-square and binomial distributions is through there variances: npq vs sum(o-e)^2/n. You can develop arguments "in the limit" that converge fairly quickly.

> --
> View this message in context: http://r.789695.n4.nabble.com/fisher-test-can-I-use-non-integer-expected-values-tp4681976p4681989.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org 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.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list