chi2_fisherexact(M)

Computes a Fisher's Exact test using data in matrix M and a significance level of 0.05 (5%).

chi2_fisherexact(M, alpha)

Computes a Fisher's Exact test using data in matrix M and a significance level alpha.


See also chi2_goodness chi2_independent 


Example


There is evidence to believe that the use of chemical contraceptives is related to obesity. A study of 11 women showed the following results:


Contraceptive
type
Obesity
Total
Obese
Normal
Chemical
4
0
4
Mechanical
2
5
7
Total
6
5
11

Entering the basic data in a matrix we obtain:

M = ( 4, 0; 2, 5)

/ 4 0 \

\ 2 5 /


We now use function chi2_totable to transform the matrix into a proper contingency table

M=chi2_totable(M)

/ "" "" "" "" \

| ""  4  0  4 |

| ""  2  5  7 |

\ ""  6  5 11 /


Using the function chi2_fisherexact we obtain,

chi2_fisherexact(M)


Fisher's Exact Test.

Hypothesis test assumes a one-tail test for association. 
For other tests, use the two-tails probability.

Ho : The two variables are not associated

Ha : The two variables are associated

Significance level : 0.05 (5.0%)

Results:


Reject the null hypothesis. (0.)

One-tail probability: 0.0454545454545454

For other tests use:

Two-tails probability: 0.06060606060606056