Fisher's Exact Test

838 views Asked by At

In this post https://stats.stackexchange.com/questions/94909/course-of-action-for-2x2-tables-with-0s-in-cell-and-low-cell-counts, OP said that s/he got a p-value 0.5152 while conducted a Fisher's exact test for the following data:

    Control Cases
  A   8       0
  B  14       0

But I am getting p-value=1 and odds ratio=0 for the data. My R codes are:

a <- matrix(c(8,14,0,0),2,2)

(res <- fisher.test(a))

Where am I doing mistake?

2

There are 2 answers

0
Jonny Phelps On

Good afternoon :)

https://en.wikipedia.org/wiki/Fisher%27s_exact_test

Haven't used these in a while, but I'm assuming its your column of two 0's:

p = choose(14, 14) * choose(8, 8)/ choose(22, 22)

which is 1.0. For odds ratio, read here: https://en.wikipedia.org/wiki/Odds_ratio

The 0's are either the numerators or the denominators. I think this makes sense, as a column of 0's effectively mean you have a group with no observations in.

0
Gustaf On

You get the strange p-value=1 and OR=0 because one or more of your counts is 0. It should not be computed by the chi-square equation, which through multiplication yields chi-values of 0 for these respective cells: Chi square equation, cell-by-cell.

Instead, you should use the Fisher's exact test ("fisher.test()") which to some extent can correct for the very low cell counts (normally you should use Fisher's for whenever you have at least 20% of cells with a count of <5). Source: https://www.ncbi.nlm.nih.gov/pubmed/23894860 Using the chi-square analysis will require you to correct using the Yates' correction, (e.g.: chisq.test(matrix, correct = T)).