Questions tagged [fishers-exact-test]

A hypothesis test for contingency tables.

Fisher's exact test is a hypothesis test for contingency tables. It returns the exact probability of finding observed counts as far or further from independence, if the rows and columns were actually independent. It is based on the hypergeometric distribution.

Fisher's exact test may be contrasted with the chi-squared test for contingency tables, which compares the observed $\chi^2$ test statistic to the (continuous) chi-squared distribution to determine the p-value, instead of computing the p-value directly. This strategy is computationally inexpensive. The sampling distribution of the $\chi^2$ test statistic will match the theoretical chi-squared distribution asymptotically (i.e., with sufficiently large samples); with smaller sample sizes the match is only approximate, however. Fisher's exact test is sometimes recommended when cells have small expected frequencies and thus the chi-squared test may not be appropriate.

There is an extension for $r \times{} c$ tables due to Freeman and Halton which is sometimes known as the Fisher-Freeman-Halton test.

402 questions
91
votes
2 answers

Given the power of computers these days, is there ever a reason to do a chi-squared test rather than Fisher's exact test?

Given that software can do the Fisher's exact test calculation so easily nowadays, is there any circumstance where, theoretically or practically, the chi-squared test is actually preferable to Fisher's exact test? Advantages of the Fisher's exact…
pmgjones
  • 5,543
  • 8
  • 36
  • 36
56
votes
2 answers

A/B tests: z-test vs t-test vs chi square vs fisher exact test

I'm trying to understand the reasoning by choosing a specific test approach when dealing with a simple A/B test - (i.e. two variations/groups with a binary respone (converted or not). As an example I will be using the data below Version Visits …
32
votes
5 answers

Fisher's Exact Test in contingency tables larger than 2x2

I was taught to only apply Fisher's Exact Test in contingency tables that were 2x2. Questions: Did Fisher himself ever envision this test to be used in tables larger than 2x2 (I am aware of the tale of him devising the test while trying to guess…
pmgjones
  • 5,543
  • 8
  • 36
  • 36
20
votes
3 answers

On Fisher's exact test: What test would have been appropriate if the lady hadn't known the number of milk-first cups?

In the famous lady tasting tea experiment by RA Fisher, the lady is informed of how many milk-first/tea-first cups there are (4 for each out of 8 cups). This respects the fixed marginal total assumption of Fisher's exact test. I was imagining doing…
19
votes
3 answers

Analysis of Danish mask study data by Nassim Nicholas Taleb (binomial GLM with complete separation)

Recently, Nassim Nicholas Taleb made this post about the recent Danish mask study, a randomized controlled trial which concluded that the proportions of newly diagnosed coronavirus infections was not significantly different among the group with…
17
votes
3 answers

Why do odds ratios from formula and R's fisher.test differ? Which one should one choose?

In the following example > m = matrix(c(3, 6, 5, 6), nrow=2) > m [,1] [,2] [1,] 3 5 [2,] 6 6 > (OR = (3/6)/(5/6)) #1 [1] 0.6 > fisher.test(m) #2 Fisher's Exact Test for Count Data data: m p-value =…
winerd
  • 569
  • 1
  • 4
  • 16
15
votes
1 answer

Fisher's Exact Test and Hypergeometric Distribution

I wanted to understand fisher exact test better, so I devised up the following toy example, where f and m corresponds to male and female, and n and y corresponds to "soda consumption" like this: > soda_gender f m n 0 5 y 5 0 Obviously,…
Alby
  • 2,103
  • 3
  • 19
  • 22
15
votes
1 answer

Which test for cross table analysis: Boschloo or Barnard?

I am analyzing a 2x2 table from a small dataset of 30 patients. We are retrospectively trying to find some variables that give a hint about which treatment to choose. The variables (obs normal / strange) and treatment decision (A/B) are of special…
14
votes
1 answer

What does the assumption of the Fisher test that "The row and column totals should be fixed" mean?

As this source states, one of the assumptions to perform Fisher's exact test of independence is that the row and column totals should be fixed. However, I find the explanation coming with it pretty vague and I couldn't find any examples illustrating…
Astarno
  • 345
  • 1
  • 8
12
votes
1 answer

Fisher Test in R

Suppose we have the following data set: Men Women Dieting 10 30 Non-dieting 5 60 If I run the Fisher exact test in R then what does alternative = greater (or less) imply? For example: mat =…
12
votes
1 answer

Fisher's exact test gives non-uniform p-values

I am trying to apply Fisher's exact test in a simulated genetics problem, but the p-values appear to be skewed to the right. Being a biologist, I guess I'm just missing something obvious to every statistician, so I would greatly appreciate your…
juod
  • 2,192
  • 11
  • 20
11
votes
2 answers

Enrichment analysis by gene duplication level

Biological Background Over time, some plant species tend to duplicate their entire genomes, gaining an additional copy of each gene. Due to the instability of this setup, many of these genes are then deleted, and the genome rearranges itself and…
11
votes
1 answer

Alternatives for chi-squared test for independence for tables more than 2 x 2

What are some alternatives to the chi-squared test for categorical variables with tables larger than 2 x 2 and cells with a count less than 5, if I don't want to merge classes?
Israel
  • 123
  • 1
  • 1
  • 8
11
votes
2 answers

What distribution does Fisher's exact test assume?

In my work I have seen several uses of Fisher's exact test, and I was wondering how well it fits my data. Looking at several sources I understood how to calculate the statistic, but never saw a clear and formal explanation of the assumed null…
10
votes
1 answer

How to interpret Cochran-Mantel-Haenszel test?

I'm testing the independence of two variables, A and B, stratified by C. A and B are binary variables and C is categorical (5 values). Running Fisher's exact test for A and B (all strata combined), I get: ## (B) ## (A) FALSE TRUE ## …
1
2 3
26 27