Wednesday 10 March 2021

Python implementation of Fisher's exact test with nxm contingency table

I would like to perform a Fisher's exact test on some binary variables that extends beyond a 2x2 contingency table (e.g. 3x2 or 4x2). But the scipy implementation only accepts a 2x2 contingency table, in contrast to the R implementation. In this similar question on SO a solution is given that uses the package rpy2, which is not an option for me. I also can not use a chi-squared test due to very small sample sizes (<5).

Any help is appreciated since I can not find a pure Python implementation.



from Python implementation of Fisher's exact test with nxm contingency table

No comments:

Post a Comment