# Fishers exact test meaning of “greater” and “less”

I'm trying to understand intuitively a one-tailed test on Fisher's exact test.

lets' say I have the voting record of Republicans (1) and Democrats (2) on gun legislation. This is the information given

           progun antigun
1      3       1
2      1       3

fisher.test(data.frame(progun,antigun),alternative="greater")


"greater" would include getting the given table above and one that shows a greater level of association between party and voting on gun legislation such as the one below

             progun antigun
1      4       0
2      0       4


But what does it mean in regards to the association when we have a situation that is "lesser"?

fisher.test(data.frame(progun,antigun),alternative="less")

also I get a p value of 0.98. why does it seem to be such a high p-value

The row and columns margins are both (4,4). The possible tables with those margins are:

| 0  4 |    | 1  3 |    | 2  2 |     | 3  1 |    | 4  0 |
| 4  0 |    | 3  1 |    | 2  2 |     | 1  3 |    | 0  4 |


Note that these tables are arranged from the most strong negative association on the left to the most strong positive association on the right.

If there's no association, the distribution of any given cell (say the top left cell) is hypergeometric. The probabilities associated with each table (under the null hypothesis) are:

   0           1           2            3           4
1/70       16/70       36/70        16/70        1/70


where the first row is the top left cell of the table and the second row are the probabilities.

One tailed tests either look at the left end or the right end of this distribution; a two tailed test looks at both ends.

A p-value is the probability of being at least as extreme as the observed table in the direction of the alternative. If you have the table with top left element 3, i.e.:

3  1
1  3


then the "greater" direction is to the right and the "lesser" direction is to the left from that table. The probability of this table and all tables to its left is (1+16+36+16)/70 = 69/70 = 0.9857... so that's the p-value for the "lesser" direction (less positive association).

It's high because you have a table showing positive association -- almost all the probability distribution is there or further left; only 1/70 of the null distribution is to the right.