Description |
Fisher's exact test is a statistical test used to determine if there are nonrandom associations between two categorical variables[1].
The job of Fisher's exact test with 2 x 2 or 2x 3 contingency table is already easily done by others. However, the one with n x m contingency table hasn't found , or with bad computation.
This function efficiently deals with Fisher's exact test with n x m contingency table.
As for the function :
[ Sig,PValue,ContigenMatrix ] = FisherExactTest( XVector,YVector )
Input : the data of two variables X,Y as XVector and YVector
Or you can just input the contingency table.
Output: "Sig" returns 1 if X and Y associate,otherwise 0
"PValue" returns the computed p-value
"ContigenMatrix" returns the n x m contingency table
Please start with "Controlcenter.m", there are two simple example for explanation. If you open the algorithm, clear description of the algorithm will be illustrated.
If there is anything wrong, or your personal need, please let me know, I will help you as soon as possible :-)
Reference:
[1] http://mathworld.wolfram.com/FishersExactTest.html |