[Scipy-tickets] [SciPy] #1489: fisher_exact throws ValueErrors when row or col is 0, 0
SciPy Trac
scipy-tickets@scipy....
Sun Aug 7 19:27:42 CDT 2011
#1489: fisher_exact throws ValueErrors when row or col is 0,0
--------------------------+-------------------------------------------------
Reporter: aihardin | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: scipy.stats | Version: 0.9.0
Keywords: fisher_exact |
--------------------------+-------------------------------------------------
Comment(by warren.weckesser):
My experience with the Fisher exact test is limited to reading the Wolfram
and wikipedia pages, so take this with the appropriate grain of salt:
If there is a row or column of zeros, the p-value is 1. The p-value is
the sum of the probabilities of the observed data and "more extreme" data,
conditioned on the marginal sums. If either a row or column is all zero,
then that data set is the only possible data set with the same row sums
and column sums, so its probability is 1; there are no other possible data
configurations to consider.
The odds ratio formula will result in 0/0. Perhaps NaN is the correct
value for the odds ratio in this case.
--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1489#comment:5>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list