Free Pearson Edexcel International A-level Mathematics · S3

Contingency tables and independence

What you’ll learn

  • Calculate expected counts under independence.
  • Use the chi-squared test for association.
  • Interpret a result without inferring causation.

Understand the idea

A contingency table cross-classifies each sampled unit by two categorical variables. Under independence, each cell probability is the product of its row and column proportions. This yields an expected count equal to the row total times the column total divided by the grand total.

Use all cells in the chi-squared sum and (r−1)(c−1)(r-1)(c-1) degrees of freedom for an rr by cc table. Observations should be independent units, and expected counts need to be large enough for the approximation. Combining categories must remain meaningful and changes the table dimensions.

A significant result supports association between the variables in the population represented by the sample. It does not identify a causal direction, and the overall statistic alone does not describe which cells drive the relationship. Inspect observed and expected counts to explain the pattern.

Key formulae

Eij=RiCjnE_{ij}=\frac{R_iC_j}{n}

X2=∑i,j(Oij−Eij)2EijX^2=\sum_{i,j}\frac{(O_{ij}-E_{ij})^2}{E_{ij}}

ν=(r−1)(c−1)\nu=(r-1)(c-1)

Worked example

Two independent groups of 50 each choose Yes or No. Group A has counts (30, 20) and Group B has (10, 40). Test independence at 5%, using the critical value 3.841 for one degree of freedom.

  1. Column totals are 40 Yes and 60 No; the grand total is 100.
  2. Each row has expected counts (50×40/100,50×60/100)=(20,30)(50\times40/100,50\times60/100)=(20,30).
  3. The statistic is 100/20+100/30+100/20+100/30=50/3≈16.667100/20+100/30+100/20+100/30=50/3\approx16.667.
  4. The degrees of freedom are (2−1)(2−1)=1(2-1)(2-1)=1. Since 16.667>3.84116.667>3.841, reject independence.

Answer: There is evidence of an association between group and response at 5%.

Open the interactive lesson to try original questions and recall. Build a revision plan.