χ2-tests

Further Maths · Further Probability & Statistics. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Further Maths topics

The idea

A χ2-test compares the frequencies you observed (O) with the frequencies a hypothesis says you should expect (E). If the hypothesis is true, O and E should be close and the test statistic is small. A large statistic is evidence against the hypothesis, so the test always uses the upper tail.

In a goodness of fit test the hypothesis is that the data follow a stated distribution, such as a fair die, a binomial or a Poisson. In a test for independence the data are in a contingency table and the hypothesis is that the two factors are not associated.

The critical value depends on the degrees of freedom. Every expected frequency must be at least 5, so small classes are combined first.

In simpler words

A chi-squared test compares what you observed with what you expected. If they are close, the test number is small. A big number suggests the idea is wrong. One test checks if data fit a pattern, like a fair die. Another checks if two things are linked, using a table. Every expected count must be at least 5, so merge small groups.

An everyday comparison

It is like checking a dice game for cheating. You roll many times and compare how often each number came up with how often it should. Small differences are just luck; big ones make you suspicious. The comparison stops working because the test needs exact degrees of freedom and expected counts of at least 5.

Rules to remember

Common mistake

Students count the degrees of freedom before combining classes, or forget to subtract 1 for each parameter estimated from the data (for example a Poisson mean worked out from the sample). Combine first, then count the classes that are left.

In the exam

State H0 and H1 in words. Find expected frequencies, with the formula, and show them in a table. Combine classes with E < 5 first, then work out ν, subtracting 1 for each estimated parameter. Calculate χ2 = Σ(O − E)2/E. State the critical value for the significance level and ν. Compare, then write a conclusion in context: 'reject H0; there is evidence of association between...'.

Worked example

A model predicts that three types of offspring occur in the ratio 1 : 2 : 1. In a sample of 80 offspring the observed frequencies are 14, 46 and 20. Test at the 5% significance level whether the model fits. The critical value for ν = 2 is 5.991.

  1. Expected frequencies: 80 × 1/4 = 20, 80 × 2/4 = 40, 80 × 1/4 = 20.
  2. χ2 = (14 − 20)2/20 + (46 − 40)2/40 + (20 − 20)2/20 = 1.8 + 0.9 + 0 = 2.7.
  3. ν = 3 − 1 = 2 (no parameters estimated). 2.7 < 5.991, so the result is not in the critical region.

Answer: χ2 = 2.7; do not reject H0. The data are consistent with the ratio 1 : 2 : 1.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Inference using normal and t-distributionsNon-parametric tests →Take a Further Maths test