-
Notifications
You must be signed in to change notification settings - Fork 10
Fisher exact test
Maurice HT Ling edited this page Aug 14, 2021
·
1 revision
Purpose: To test whether 2 categorical variables (defining the rows and columns) are independent in 2x2 contingency table.
Null hypothesis: There is no relationship between between the 2 categorical variables; that is, the 2 categorical variables are not independent.
Alternate hypothesis: There is a relationship between the 2 categorical variables; that is, the 2 categorical variables are not independent.
Note:
- Fisher exact test is commonly used in place of Chi-square test of independence in event of small sample size.
- Barnard exact test and Boschloo’s exact test are more robust than Fisher exact test.
Code:
>>> from scipy import stats
>>> table = [[77, 404],
... [16, 122]]
>>> result = stats.fisher_exact(table)
>>> print("Odds ratio = %.3f" % result[0])
Odds ratio = 1.453
>>> print("p-value = %.3f" % result[1])
p-value = 0.225
Reference:
- Fisher RA. 1922. On the interpretation of χ2 from contingency tables, and the calculation of P. Journal of the Royal Statistical Society 8(1), 87–94.
Copyright (c) 2008-2024, Maurice HT Ling
Refereed Publications and Technical Reports
Abstracts and Other Un-Refereed Works
Autobiographic Verses (Poems that I wrote) and My Sayings