Boost logo

Boost :

From: Johan Råde (rade_at_[hidden])
Date: 2008-05-05 14:49:43


There is one difficulty with the two-sided Fisher exact test.

To calculate a p-value for the left-sided test,
you take the cdf of the hypergeometric distribution
for the observed value of the test statistica.
I you want to calculate a p-value for the right-sided test,
then you just take cdf complement for the observed value of the test statistica.

But for a two-sided test, well, say that the observed value
of the test statistica is n. Then you should sum the pdf over all k
such that pdf(k) <= pdf(n). This means summing over both tails.
And since the distribution is not symmetric,
you can not just sum over one tail and multiply by 2,
as you do with the 2-sided t-test.

I don't see how to do that in a clean way using the current
statistical distributions API. (Am I missing something?)
Maybe some extension to the statistical distributions API is needed.
Something like cdf(symmetric(dist,x)) for the sum/integral of pdf(dist,y)
over all y such that pdf(dist,y) <= pdf(dist,x).

--Johan Råde


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk