Chi-square tests

About this lesson

Statistics (AP-aligned) › Significance tests

To save a PDF, choose “Save as PDF” in the print dialog.

Chi-square tests

Significance tests.

Warm-up

Three quick questions from earlier lessons.

Discover

A die is rolled 60 times. If it is fair, how many times do you expect each face?

  1. 10
  2. 60

Key idea

Compare observed counts with expected counts.

χ2=∑(O−E)2E\chi^2 = \sum \dfrac{(O - E)^2}{E}. Goodness of fit: E=n×piE = n \times p_i, df == (categories −1- 1). Two-way table (independence or homogeneity): E=row total×column totalgrand totalE = \dfrac{\text{row total} \times \text{column total}}{\text{grand total}}, df =(r−1)(c−1)= (r - 1)(c - 1). Large χ2\chi^2 (small P-value) is evidence against H₀. Condition: all expected counts at least 5.

Worked example

Die: observed 14 sixes, expected 10.

Contribution =1.6= 1.6
(14 − 10)²/10.
df =5= 5
Six faces.
χ2\chi^2 is the sum
Add all six contributions.

Your turn, guided

Your turn: a 3 × 4 two-way table. Degrees of freedom.

66
(3 − 1)(4 − 1).

Practice ★

  1. A die is rolled 114 times to test whether it is fair. What is the expected count for each face?
  1. In a chi-square test, one category has observed count 39 and expected count 21. Find its contribution to χ².
  2. In a chi-square test, one category has observed count 16 and expected count 27. Find its contribution to χ².

Watch out!

Practice ★★

  1. In a two-way table with grand total 158, a row total is 55 and a column total is 41. Find the expected count in that cell under independence.
  2. In a two-way table with grand total 134, a row total is 53 and a column total is 40. Find the expected count in that cell under independence.

Exit ticket

Three questions to check you have got it.

  1. In a chi-square test, one category has observed count 39 and expected count 21. Find its contribution to χ².
  2. In a chi-square test, one category has observed count 16 and expected count 27. Find its contribution to χ².
  3. In a chi-square test, one category has observed count 20 and expected count 16. Find its contribution to χ².

Summary card

Chi-square tests

χ2=∑(O−E)2/E\chi^2 = \sum (O - E)^2/E; GOF: E=npE = np; two-way: E=E = row × column / total.

Watch out: divide by EE; use counts, not percentages.

End of the lesson

CC BY-SA 4.0