Chi-squared tests
Objective. Test goodness of fit and association.
- 1. Learn
- 2. Worked example
- 3. Practice
- 4. Feedback
- 5. Continue
Learn: the key idea
A chi-squared test compares observed frequencies O with expected frequencies E under a hypothesised model, using the test statistic χ² = Σ[(O−E)²/E], summed over all categories, and compared against a critical value from chi-squared tables with the appropriate degrees of freedom. This test is used both for goodness of fit (does data follow a given distribution) and for tests of association (are two categorical variables independent), with degrees of freedom calculated differently in each case. For a goodness of fit test with k categories, the degrees of freedom is k minus 1 minus the number of estimated parameters.
Worked example
A die is rolled 60 times with observed frequencies 8,12,9,11,10,10 for faces 1–6. Calculate the chi-squared test statistic for testing whether the die is fair.
- 1Expected frequency for each face under fairness is 60/6 = 10
- 2Compute (O−E)²/E for each face: (8−10)²/10=0.4, (12−10)²/10=0.4, (9−10)²/10=0.1, (11−10)²/10=0.1, (10−10)²/10=0, (10−10)²/10=0
- 3Sum these values: 0.4+0.4+0.1+0.1+0+0
- 4Total χ² = 1.0
Answer: χ² = 1.0
Concept mastery
Based on your past attempts at this lesson — the question types to practise again come first.
Complete a practice set to see your concept breakdown here.
Practice
Practice happens on its own screen, one question at a time. Answers stay hidden until you submit yours, and you can stop and pick up at the same question later.
Start practisingCommon mistake. Students use the raw difference (O−E) instead of squaring it, or forget to divide each squared difference by its own expected frequency E before summing. Each term must be (O−E)²/E, computed separately for every category.
Your progress
Tick each step as you finish it. Your exact reading position is saved automatically, so Continue drops you back on the same line.
0 of 5 steps complete
Your place saves automatically as you read.