We could also be extra careful and note the ranges of the variables. The likelihood above could have the indicator product I(0 I(0 This x m) y n). would be transformed to I(0 I(0 a little more to say x m) t x n). We’ll have about this below, at the bottom of page 3. Since = + its distribution under the null hypothesis would be binomial (m+n, T X Y, p). That is, the probability law of is T = f(t) now find the conditional probability law of given = This is X, T t. Let’s | = = f(x t) = that all the factors in cancel. p It’s quite amazing This is the conditional probability law of given a total number of successes This X, t. conditional law is hypergeometric, saying that the number of successes in group 1 is based on random draws from a set of + values, of which are successes. m m n t This hypergeometric forms the basis for are Fisher’s exact test. No approximations needed! However, the hypergeometric distribution is a little in the sense to be “gritty” noted below on page 4, and we may have trouble using it. Here is an example which shows in action. Suppose that we want to Fisher’s exact test compare the success rates for two different brands of arthritis medication. Brand was Q tested on 10 subjects, and brand was tested on 12 subjects. Each subject was asked R whether the treatment provided any relief. The responses were these: Brand Successes Failures Total 2 8 10 Q 8 4 12 R Total 10 12 22 The obvious null hypothesis is = . We want = 0.05 as the level of H0: pQ pR significance. We are tempted to use the chisquared statistic, but the sample sizes are too small to make the approximate distribution believable. Just for the record, the value would be 2 4.7911. Suppose that the alternative hypothesis were > . That is, suppose that the H1: pQ pR experiment was set up by someone expecting to show that brand was better. An Q immediate look at the data shows that product was There is no way that has Q worse. H1 any chance at all. With no serious computation, we simply accept and move on. H0
We could also be extra careful and note the ranges of the variables. The likelihood above could have the indicator product I(0 x m) I(0 y n). This would be transformed to I(0 x m) I(0 t x n). We’ll have a little more to say about this below, at the bottom of page 3. Since T = X + Y, its distribution under the null hypothesis would be binomial (m+n, p). That is, the probability law of T is f(t) = Let’s now find the conditional probability law of X, given T = t. This is f(x | t) = = = It’s quite amazing that all the factors in p cancel. This is the conditional probability law of X, given a total number of successes t. This conditional law is hypergeometric, saying that the number of successes in group 1 is based on m random draws from a set of m + n values, of which t are successes. This hypergeometric forms the basis for Fisher’s exact test. No approximations are needed! However, the hypergeometric distribution is a little “gritty” in the sense to be noted below on page 4, and we may have trouble using it. Here is an example which shows Fisher’s exact test in action. Suppose that we want to compare the success rates for two different brands of arthritis medication. Brand Q was tested on 10 subjects, and brand R was tested on 12 subjects. Each subject was asked whether the treatment provided any relief. The responses were these: Brand Successes Failures Total Q 2 8 10 R 8 4 12 Total 10 12 22 The obvious null hypothesis is H0: pQ = pR . We want = 0.05 as the level of significance. We are tempted to use the chisquared statistic, but the sample sizes are too small to make the approximate distribution believable. Just for the record, the value would be 2 4.7911. Suppose that the alternative hypothesis were H1: pQ > pR . That is, suppose that the experiment was set up by someone expecting to show that brand Q was better. An immediate look at the data shows that product Q was worse. There is no way that H1 has any chance at all. With no serious computation, we simply accept H0 and move on.