Fisher's Exact Test

From Dave's wiki
Jump to navigation Jump to search

Fisher's Tea Drinker

https://stat.ethz.ch/R-manual/R-patched/library/stats/html/fisher.test.html

A British woman claimed to be able to distinguish whether milk or tea was added to the cup first. To test, she was given 8 cups of tea, in four of which milk was added first. The null hypothesis is that there is no association between the true order of pouring and the woman's guess, the alternative that there is a positive association (that the odds ratio is greater than 1).

TeaTasting <- matrix(c(3, 1, 1, 3),
                     nrow = 2,
                     dimnames = list(Guess = c("Milk", "Tea"),
                                     Truth = c("Milk", "Tea"))
                     )

TeaTasting
      Truth
Guess  Milk Tea
  Milk    3   1
  Tea     1   3

fisher.test(TeaTasting, alternative = "greater")

	Fisher's Exact Test for Count Data

data:  TeaTasting
p-value = 0.2429
alternative hypothesis: true odds ratio is greater than 1
95 percent confidence interval:
 0.3135693       Inf
sample estimates:
odds ratio 
  6.408309