2
$\begingroup$

I have this matrix:

x <- c(2, 38, 196, 2)

contingency <- matrix(x, nrow = 2, byrow = TRUE)

print(contingency)

     [,1] [,2]
[1,]    2   38
[2,]  196    2

And I've carried out this Fisher's Exact Test:

fisher.test(contingency)

which outputs this:

    Fisher's Exact Test for Count Data

data:  contingency
p-value < 2.2e-16
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
 6.103516e-05 4.703333e-03
sample estimates:
 odds ratio
0.000701445

My questions are:

The values in the matrix (2, 38, 196, 2) are means. Is it ok to run a Fisher’s Exact Test on these data?

If I was to conclude that the proportions in each group are unlikely to be equal, would i be correct?

$\endgroup$
4
  • 1
    $\begingroup$ Do you have the raw counts? If so you should use them. Fisher's test looks at all possible permutations of the 2x2 tables where the row and column sums are fixed. The p-value is determined by which tables are more extreme under the null hypothesis than the observed table. Since you are inputting integers Fisher's test will give you a result but it is not what you want. $\endgroup$ Dec 15 '16 at 20:55
  • $\begingroup$ Under the null hypothesis that the the proportion for one group is the same as for the other the probability for an individual table has a hypergeometric distribution. Besides the fact that you said you are using means we also need to know what the rows and columns represent in terms of the categories. $\endgroup$ Dec 15 '16 at 21:13
  • 1
    $\begingroup$ For example if the columns represent gender and the rows represents whether or not the subject studied for a test., the null hypothesis would be that the proportion of males that studied for the test is the same as for the females. $\endgroup$ Dec 15 '16 at 21:18
  • $\begingroup$ The result sums the hypergeometric probabilities associated with tables as extreme or more extreme than the observed table. That would be those where calculated proportions are more different than the observed proportions as well as adding the hypergeometric probability for the observed table. $\endgroup$ Dec 15 '16 at 21:32
2
$\begingroup$

The values in the cell of these tables should not be means, they should be counts. Fisher's test is valid only for contingency tables.

$\endgroup$
1
$\begingroup$

While there is nothing that can stop you from running Fishcer's Exact test like you do, it simply doesn't make sense.

The test assumes the totals in the experiment is fixed in advanced, which is not the case if you have floating mean values. The test gives you p-value by calculating all possible permutations, which can't be done for continuous data like sample means.

If you want to compare the means, consider t-test or ANOVA depend on your data set.

$\endgroup$
1
  • $\begingroup$ In order to obtain a p-value you only need the permutations that give tables as extreme or more extreme than the observed one. Also things get restricted because Fisher conditions on the marginal totals. I think the OP really wants to look at the contingency table and if counts are available nothing makes Fisher's test unreasonable. $\endgroup$ Dec 17 '16 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.