TIP: Fisher's exact test is designed to test the independence of rows and columns in a contingency table with fixed margins.
The Example of Fisher's Exact Test for 2x2 Tables:
Fisher's Tea-Tasting Experiment:
Dr. Muriel Bristol, a colleague of Fisherâs, claimed that when drinking tea she could distinguish whether milk or tea was added to the cup first (she preferred milk first). To test her claim, Fisher asked her to taste eight cups of tea, four of which had milk added first and four of which had tea added first. She knew there were four cups of each type and had to predict which four had the milk added first. The order of presenting the cups to her was randomized.
A possible result is as follows:
Guess Poured First Pored First Milk Tea Total Milk 3 1 4 Tea 1 3 4 Total 4 4 8
The test result is as follows:
Your dataset:3 1 1 3 Dataframe: col1 col2 row1 3 1 row2 1 3 Fisher's Exact Test for Count Data data: data 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