All subjects · Mathematics · WST03 Statistics 3

Contingency tables

Edexcel IAL Mathematics · WST03 Statistics 3

A contingency table shows frequencies classified by two factors. The χ2 test asks whether the two factors are independent (not associated).

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

Hypotheses and expected frequencies

If H0 is true, E = (row total × column total) / grand total for each cell. For under-30s using a car: 80 × 80/160 = 40.

CarBusCycleTotal
Under 3028223080
30 and over52181080
Total804040160

How 160 commuters travel to work

Degrees of freedom

For a table with r rows and c columns: ν = (r - 1)(c - 1). Once the row and column totals are fixed, only (r - 1)(c - 1) cells can be filled freely.

Examiners report errors such as 3 - 1 or 9 - 1 for a 3 × 3 table, where the correct value is 2 × 2 = 4.

If any E < 5, combine rows or columns that make sense together, then recount r and c.

Example

Expected: 40, 20, 20 (under 30) and 40, 20, 20 (30 and over).

X2 = Σ(O - E)2/E = 17.6. ν = (2 - 1)(3 - 1) = 2; 5% critical value 5.991. 17.6 > 5.991, so reject H0: there is evidence of an association between age group and method of travel.

To comment on the association, compare O with E: under-30s cycle more than expected (30 against 20); people aged 30 and over use the car more than expected.

Worked example

A 3 × 4 contingency table has one column whose expected frequencies are all below 5; it is combined with a neighbouring column. Find ν.

  1. After combining there are 3 rows and 3 columns.
  2. ν = (3 - 1)(3 - 1)

Answer: ν = 4

Key idea: E = row total × column total ÷ grand total; ν = (r - 1)(c - 1); H0 no association; compare O with E to describe any association.

Check yourself

  1. In the commuter table, find the expected frequency for people aged 30 and over who cycle.
    Show answer

    20. 80 × 40/160 = 20.

  2. Calculate X2 for the commuter table.
    Show answer

    17.6. Contributions: 3.6, 0.2, 5, 3.6, 0.2, 5; total 17.6.

  3. How many degrees of freedom are there for a 2 × 3 contingency table?
    Show answer

    2. (2 - 1)(3 - 1) = 2.

  4. How many degrees of freedom are there for a 3 × 4 contingency table with no cells combined?
    Show answer

    6. (3 - 1)(4 - 1) = 6.

  5. Find the 1% critical value of χ2 with 2 degrees of freedom. Give your answer to 3 decimal places.
    Show answer

    9.210. From the table: 9.210.

  6. X2 = 17.6 with ν = 2 at the 5% level (critical value 5.991). Which conclusion is correct?
    • Reject H0: there is evidence of an association between age group and method of travel
    • Do not reject H0: age and travel method are independent
    • Reject H0: age causes people to cycle
    • Do not reject H0, because X2 is less than 17.6
    Show answer

    Reject H0: there is evidence of an association between age group and method of travel. X2 exceeds the critical value; a χ2 test shows association, not causation.

  7. Which observation best describes the nature of the association in the commuter table?
    • People aged 30 and over cycle more often than expected
    • Under-30s use cars more often than expected
    • People under 30 cycle more often than would be expected under independence
    • Bus use is very different between the age groups
    Show answer

    People under 30 cycle more often than would be expected under independence. Under-30 cyclists: observed 30, expected 20, the biggest contribution.

  8. Which is a correct null hypothesis for a contingency table test?
    • The two factors are associated
    • All the observed frequencies are equal
    • The expected frequencies are all at least 5
    • There is no association between the two factors
    Show answer

    There is no association between the two factors. H0 is independence (no association).

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.