DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


FisherExactTest

Declaration: FisherExactTest (FreqTab: TInt2DArray; var ProbLow, ProbHigh, Prob2Tail: double): integer;
The function FisherExactTest calculates the probabilities of Fisher's exact test of independence for the 2x2 contingency table FreqTab. The variable parameters ProbLow, ProbHigh and Prob2Tail return the probabilities for the one-tailed lower tail, the one-tailed upper tail and the two-tailed test, respectively.

The function returns the following error codes:

 0 ... everything is OK
-1 ... frequency table is not a 2x2 table
-2 ... frequency table too large (N must be less than 1001)
-3 ... frequency table must not contain negative numbers