BIOL2001 Chap.8 Hypothesis Testing With Chi-Square and Fisher's Test
Hypothesis Testing With Chi-Square and Fisher's Test
Is the pattern more than chance?
Biological data always carry natural variation and sampling error, so a difference in a sample might be chance. Null hypothesis significance testing frames the question: the null hypothesis claims no effect, the p-value is the probability of results at least as extreme if the null were true, and the alpha threshold, usually 0.05, decides whether to reject it.
The chapter sets out the five-step testing workflow and what a p-value is not.
Chi-square and Fisher's exact test
A computed chi-square curve shows the critical value at 3 degrees of freedom and where an observed statistic from a pea cross falls. A worked test of association asks whether lizard colour morph depends on island, from expected counts to the decision.
The chapter explains degrees of freedom for one variable and for contingency tables, Type I and Type II errors, the limits of chi-square with small expected counts, and when to use Fisher's exact test instead.
What this chapter covers
- 01
Null and alternative hypotheses
- 02
P-values and the alpha threshold
- 03
The five-step testing workflow
- 04
The chi-square statistic
- 05
Goodness-of-fit tests
- 06
Tests of association on contingency tables
- 07
Degrees of freedom
- 08
Type I and Type II errors
- 09
Fisher's exact test for small samples
Worked example · free
A goodness-of-fit test on a dihybrid cross
- 1Expected counts under 9:3:3:1 are 90, 30, 30 and 10.
- 1Contributions (o − e)2/e are 0.400, 0.533, 0.300 and 0.100, so chi-square = 1.333.
- 1Degrees of freedom are 4 − 1 = 3, and the critical value at alpha = 0.05 is 7.815.
- 11.333 is far below 7.815 (p = 0.72), so the null hypothesis that the 9:3:3:1 model fits is not rejected.
Key terms
- Alpha Level
- The threshold below which a p-value counts as statistically significant, usually 0.05.
- Chi-Square Statistic
- The sum over categories of squared observed minus expected counts divided by the expected counts.
- Degrees of Freedom
- The number of values that can vary freely once totals or other constraints are fixed.
- Type I Error
- Rejecting a null hypothesis that is actually true.
- Type II Error
- Failing to reject a null hypothesis that is actually false.
- Critical Value
- The value of a test statistic beyond which the null hypothesis is rejected at a given alpha.
Hypothesis Testing With Chi-Square and Fisher's Test FAQ
What does a p-value actually tell me?
A p-value measures how surprising the data would be if the null hypothesis held: the chance of a result at least as far from its prediction as the one observed. It does not tell you how likely the null hypothesis is to be true, nor whether chance made the pattern, and it says nothing about how big or important an effect is.
How do I calculate degrees of freedom for a chi-square test?
For a goodness-of-fit test on one variable, the degrees of freedom are the number of categories minus one. For a test of association on a contingency table, they are the number of rows minus one multiplied by the number of columns minus one, so a two-by-two table has one.
When should I use Fisher's exact test instead of chi-square?
Use Fisher's exact test when any expected count is below 5, and especially below 1, or when the total sample is small, under about 50. Chi-square becomes unreliable in those cases, while Fisher's test computes the p-value directly from the counts and is run in R with fisher.test().
Does failing to reject the null hypothesis prove it is true?
No. Failing to reject means only that the data are consistent with the null hypothesis. A larger sample or a better design might still detect an effect, so report the result as no statistically significant difference rather than as evidence of no difference.
Assessment move
Memorise the five-step workflow and write it out for every practice test until it is automatic. Compute one goodness-of-fit and one association test fully by hand, then repeat them with chisq.test() to check. For each result, write a one-sentence report naming the test, statistic, degrees of freedom, p-value and decision.
Keep the critical values for 1, 3 and 6 degrees of freedom at alpha = 0.05 in mind, 3.841, 7.815 and 12.592, so that you can judge a statistic quickly before computing its exact p-value.
Working through Hypothesis Testing With Chi-Square and Fisher's Test in BIOL2001? Sia is AskSia’s AI Statistics tutor — ask any BIOL2001 Hypothesis Testing With Chi-Square and Fisher's Test question and get a clear, step-by-step explanation grounded in how BIOL2001 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.
STAT1008 Quantitative Research Methods · BIOL1030 Diversity of Life · STAT7038 Regression Modelling