# Fisher Algorithm

Performed on a set of non-negative numbers and labels of size N. There must be two specific labels. Label 1 must be 1 and label 2 must be 2. There can also be any other labels that will be ignored.

Consider all numbers greater than 0 as 1. Construct the following table:

 Column1 Column2 Total Row1 a b r1 Row2 c d r2 Total s1 s2 N

Where:
• a is the number of 1 values in group 1.
• b is the number of 1 values in group 2.
• c is the number of 0 values in group 1.
• d is the number of 0 values in group 2.
• r1 = a + b
• r2 = c + d
• s1 = a + c
• s2 = b + d
• N = r1 + r2 = s1 + s2

Rearrage the table so a is the smallest value. There are two possible rearranging moves:
• Swap Row1 and Row2.
• Swap Column1 and Column2.

#### Fisher's Exact value

1. Chi1:
• E:
2. Chi2:
• E:
3. Chi3:
• E:
4. Chi4:
• E:
5. Chi-Square: Chi1 + Chi2 + Chi3 + Chi4

#### Fisher's Exact probability

The probability for a table is calculated by .

The following table is called "Set 0":
 Column1 Column2 Total Row1 0 B r1 Row2 C D r2 Total s1 s2 N

1. Determine the number of table probabilities to calculate by finding the smallest marginal total (least value among r1, r2, s1, s2) and adding 1.
2. Generate the table for "Set 0"
• A = 0
• B = b + a
• C = c + a
• D = d - a
• Totals remain unchanged.
3. Calculate the probability of "Set 0"
• :
• This is because in "Set 0" A! = 1, = 1, and = 1.
4. Calculate probabilities for other tables where A = {1, 2, ..., smallest marginal total}
• :
5. P-value: where <= +

### Remarks

• When the P-value gets very close to 1 and should in fact be 1, it is necessary to make a correction.
Topic revision: r5 - 09 Dec 2004, WillGray

• Biostatistics Webs

Copyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki? Send feedback