Australian National University · FACULTY OF STATISTICS

BIOL2001 Chap.8 Hypothesis Testing With Chi-Square and Fisher's Test

- one subject, every graph, every model, every mark
9 Chapters5-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 8 of 15 · BIOL2001

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.

In this chapter

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

Q [4 marks]. Of 160 offspring from a pea cross, 96, 26, 27 and 11 fall in the four phenotypes, where Mendelian inheritance predicts a 9:3:3:1 ratio. Test the fit at alpha = 0.05. The practice weighting is assigned by AskSia and is not an official assessment.
The chi-square distribution with 3 degrees of freedom.The chi-square distribution with 3 degrees of freedom. The shaded right tail beyond the critical value 7.815 holds 5% of the area; the observed statistic of 1.33 from the pea cross falls far to the left of it, so the null hypothesis is not rejected.chi-square value, df = 3density024681012critical value 7.815reject H0: 5%observed 1.33
The chi-square distribution with 3 degrees of freedom. The shaded right tail beyond the critical value 7.815 holds 5% of the area; the observed statistic of 1.33 from the pea cross falls far to the left of it, so the null hypothesis is not rejected.
  • 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.
The chi-square statistic is 1.333 with 3 degrees of freedom and a p-value of about 0.72. The data are consistent with the 9:3:3:1 ratio, which is not the same as proving the ratio is correct.
Sia tip — Divide each squared difference by its expected count, not its observed count; using observed counts gives a different statistic that the chi-square table does not describe.
Glossary

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.
FAQ

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.

Study strategy

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.

A+Everything unlocked
Unlocks this Bible + all 46 of your Australian National University subjects - and 1,000+ Bibles across every Australian university.
Sia - your BIOL2001 tutor, unlimited, worked the way the exam marks it
The full 5-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works