
FISHER EXACT TESTName:
Conover idenifies three distinct scenarios for contingency tables:
Note that the Fisher exact test returns the same pvalue for each of these models. What does change is the power of the test. The power of the test is highest when the row and column totals are both fixed. That is, when the row and column totals are fixed, the Fisher exact test really is exact. However, when either the row or column totals is random, the test is still valid. However, it may become too conservative. The Fisher exact test is based on the probability of obtaining a table more extreme than the observed table. For example, for the 2x2 case when both row and column totals are fixed, the test statistic is the frequency of the row 1, column 1 cell. This is compared to the hypergeometric distribution. The Fisher exact test is typically used when the row and column totals are small. When they are large, the chisquare independence test is sufficiently accurate. In addition, the computational burden of the Fisher exact test can become prohibitively high as the marginal totals get higher (and the values of R and C increase). Dataplot computes the Fisher exact test using ACM algorithm 643, the FEXACT routine, written by Mehta and Patel. This algorithm supports the RxC case (not just the 2x2 case) and is based on a network algorithm. See the Mehta and Patel articles given in the References section for details of the algorithm.
<SUBSET/EXCEPT/FOR qualification> where <y1> is the first response variable; <y2> is the second response variable; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax is used for the case where you have raw data (i.e., the data has not yet been cross tabulated into a twoway table).
where <m> is a matrix containing the twoway table; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax is used for the case where we the data have already been crosstabulated into a twoway contingency table.
where <n11> is a parameter containing the value for row 1, column 1 of a 2x2 table; <n12> is a parameter containing the value for row 1, column 2 of a 2x2 table; <n21> is a parameter containing the value for row 2, column 1 of a 2x2 table; <n22> is a parameter containing the value for row 2, column 2 of a 2x2 table. This syntax is used for the special case where you have a 2x2 table. In this case, you can enter the 4 values directly, although you do need to be careful that the parameters are entered in the order expected above.
FISHER EXACT TEST M FISHER EXACT TEST N11 N12 N21 N22
The default values are referred to as the Cochran conditions:
PERCNT = 80.0 EMIN = 1.0 The following commands can be entered to change the default settings:
SET FISHER EXACT TEST PERCNT <value> SET FISHER EXACT TEST EMIN <value>
Mehta and Patel (1983), "A Network Algorithm for Performing Fisher's Exact Test in rxc Contingency Tables," Journal of the American Statistical Association, Vol.78. No, 382, pp. 427434. Conover (1999), "Practical Nonparametric Statistics," Third Edition, Wiley, pp. 204216.
. Example from page 190 of Conover read matrix m 1 9 3 1 end of data . fisher exact test mThe following output is generated: FISHER EXACT TEST FOR INDEPENDENCE (RXC TABLE) NULL HYPOTHESIS: THE TWO VARIABLES ARE INDEPENDENT ALTERNATIVE HYPOTHESIS: THE TWO VARIABLES ARE NOT INDEPENDENT SAMPLE 1: NUMBER OF OBSERVATIONS = 14 NUMBER OF LEVELS (ROWS) = 2 SAMPLE 2: NUMBER OF OBSERVATIONS = 14 NUMBER OF LEVELS (COLUMNS) = 2 PROBABILITY OF OBSERVED TABLE = 0.3996005E01 PVALUE = 0.4095904E01 CDF VALUE OF TEST STATISTIC = 0.9590409 TWOSIDED TEST: NULL HYPOTHESIS NULL NULL CONFIDENCE ACCEPTANCE HYPOTHESIS HYPOTHESIS LEVEL INTERVAL CONCLUSION ========================================================= INDEPENDENT 50.0% (0.250,0.750) REJECT INDEPENDENT 80.0% (0.100,0.900) REJECT INDEPENDENT 90.0% (0.050,0.950) REJECT INDEPENDENT 95.0% (0.025,0.975) ACCEPT INDEPENDENT 99.0% (0.005,0.995) ACCEPTProgram 2: . Example from page 160 of Mehta and Patel ACM paper read matrix m 1 2 2 1 1 0 2 0 0 2 3 0 0 1 1 1 2 7 1 1 2 0 0 0 0 1 1 1 1 0 end of data . fisher exact test mThe following output is generated: FISHER EXACT TEST FOR INDEPENDENCE (RXC TABLE) NULL HYPOTHESIS: THE TWO VARIABLES ARE INDEPENDENT ALTERNATIVE HYPOTHESIS: THE TWO VARIABLES ARE NOT INDEPENDENT SAMPLE 1: NUMBER OF OBSERVATIONS = 34 NUMBER OF LEVELS (ROWS) = 5 SAMPLE 2: NUMBER OF OBSERVATIONS = 34 NUMBER OF LEVELS (COLUMNS) = 6 PROBABILITY OF OBSERVED TABLE = 0.7752854E10 PVALUE = 0.2583887E01 CDF VALUE OF TEST STATISTIC = 0.9741611 TWOSIDED TEST: NULL HYPOTHESIS NULL NULL CONFIDENCE ACCEPTANCE HYPOTHESIS HYPOTHESIS LEVEL INTERVAL CONCLUSION ========================================================= INDEPENDENT 50.0% (0.250,0.750) REJECT INDEPENDENT 80.0% (0.100,0.900) REJECT INDEPENDENT 90.0% (0.050,0.950) REJECT INDEPENDENT 95.0% (0.025,0.975) ACCEPT INDEPENDENT 99.0% (0.005,0.995) ACCEPT  
Date created: 10/21/2008 Last updated: 12/11/2023 Please email comments on this WWW page to alan.heckert@nist.gov. 