Bayesian Fisher's Exact Test
Bayesian Fisher's Exact Test for 2x2 Contingency Tables · Also known as: Bayesian exact test for independence, Bayesian contingency table test, Bayes factor Fisher test, BFexact
The Bayesian Fisher's exact test evaluates independence between two categorical variables in a 2x2 table by computing a Bayes factor rather than a p-value. Using conjugate priors on cell probabilities — most commonly the Gunel-Dickey framework — it quantifies how much the observed data favor an association model over an independence model, providing a continuous scale of evidence in both directions.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use the Bayesian Fisher's exact test when your data form a 2x2 contingency table — two binary categorical variables — especially with small cell counts where the asymptotic chi-square approximation is unreliable. It is the preferred choice when you need to quantify evidence for independence (not just reject association), when you want to accumulate evidence across sequential studies, or when you are working in a Bayesian analysis framework. Do not use it for tables larger than 2x2 (use Bayesian chi-square or log-linear models), when all cell counts are large and asymptotic approximations are accurate, or when you have ordinal variables for which rank-based tests are more appropriate.
Strengths & limitations
- Quantifies evidence for both association and independence on a continuous scale, unlike p-values which only allow rejection of the null.
- Exact computation even with small or zero cell counts, where asymptotic tests break down.
- Closed-form Bayes factors under the Gunel-Dickey framework require no simulation and are reproducible.
- Naturally handles sequential updating of evidence without inflating Type I error.
- Provides posterior model probabilities enabling direct probabilistic statements about independence vs. association.
- Restricted to 2x2 tables; larger contingency tables require different Bayesian approaches.
- Results depend on the prior specification; the concentration parameter affects the Bayes factor and requires sensitivity analysis.
- Choosing the correct sampling model (multinomial, independent-multinomial, hypergeometric) is not always obvious and changes the result.
- Less familiar to reviewers trained exclusively in frequentist methods, which may complicate peer review.
Frequently asked
How is this different from the classical Fisher's exact test?
The classical test computes a p-value — the probability of a table as extreme as observed under the null — and rejects when p < 0.05. The Bayesian version computes a Bayes factor quantifying the relative evidence for association vs. independence. Unlike the p-value, the Bayes factor can provide formal evidence in favor of independence and is sensitive to the prior, not just the sample size.
Which prior should I use?
The Gunel-Dickey default priors are the standard objective starting point and are implemented in JASP and the BayesFactor R package. They correspond to a non-informative prior over the cell probabilities for the chosen sampling model. If you have substantive knowledge about the likely strength of association, you can increase the concentration parameter and then confirm robustness with a sensitivity analysis.
What Bayes factor value indicates a meaningful result?
Jeffreys' scale is widely used: BF10 between 1 and 3 is anecdotal evidence for association, 3–10 is moderate, and above 10 is strong. Symmetrically, BF10 below 1/3 is moderate evidence for independence. These are interpretive guidelines, not decision thresholds; report the Bayes factor as a continuous measure alongside posterior model probabilities.
Can I use this test when one or more cells have zero counts?
Yes. The exact computation and conjugate prior structure handle zero counts naturally — a major advantage over asymptotic chi-square tests. Zero counts are informative (strong evidence that a category combination is rare) and the Bayes factor reflects that without requiring continuity corrections.
Where is it implemented?
JASP offers the Bayesian contingency table test (Gunel-Dickey) via point-and-click interface. The BayesFactor R package implements it via the contingencyTableBF() function. The formulas in Jamil et al. (2017) provide full details for custom implementations.
Sources
- Gunel, E., & Dickey, J. (1974). Bayes factors for independence in contingency tables. Biometrika, 61(3), 545–557. DOI: 10.1093/biomet/61.3.545 ↗
- Jamil, T., Ly, A., Morey, R. D., Love, J., Marsman, M., & Wagenmakers, E.-J. (2017). Default Gunel and Dickey Bayes factors for contingency tables. Behavior Research Methods, 49(2), 638–652. DOI: 10.3758/s13428-016-0739-8 ↗
How to cite this page
ScholarGate. (2026, June 3). Bayesian Fisher's Exact Test for 2x2 Contingency Tables. ScholarGate. https://scholargate.app/en/statistics/bayesian-fishers-exact-test
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Bayesian chi-square testStatistics↔ compare
- Bayesian Independent Samples t-testStatistics↔ compare
- Chi-square testStatistics↔ compare
- Fisher's exact testStatistics↔ compare