You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
The chi-squared (χ2) goodness of fit test is used to determine whether observed data follow a particular theoretical distribution. This is a key hypothesis testing technique in Further Statistics.
You have observed frequencies Oi from an experiment or survey, and expected frequencies Ei from a theoretical model (e.g., uniform, binomial, Poisson, normal). The test asks: are the differences between observed and expected frequencies larger than what we would expect from random variation alone?
X2=∑iEi(Oi−Ei)2
This statistic measures the overall discrepancy between observed and expected. Under the null hypothesis, X2 approximately follows a chi-squared distribution with ν degrees of freedom.
ν=(number of classes)−1−(number of estimated parameters)
| Scenario | Parameters estimated | ν |
|---|---|---|
| Testing a uniform distribution | 0 | k−1 |
| Testing a Poisson distribution with known λ | 0 | k−1 |
| Testing a Poisson distribution with λ estimated from data | 1 | k−2 |
| Testing a binomial with known p | 0 | k−1 |
| Testing a binomial with p estimated from data | 1 | k−2 |
| Testing a normal with both μ and σ2 estimated | 2 | k−3 |
Step 1: State the hypotheses.
H0: The data follow the specified distribution. H1: The data do not follow the specified distribution.
Step 2: Calculate expected frequencies Ei from the theoretical model.
Step 3: Combine classes if any Ei<5 (this ensures the chi-squared approximation is valid).
Step 4: Calculate the test statistic X2=∑Ei(Oi−Ei)2.
Step 5: Find the degrees of freedom ν.
Step 6: Compare X2 with the critical value from χν2 tables at the given significance level.
Step 7: Conclude: if X2>critical value, reject H0; otherwise, do not reject H0.
Exam Tip: You must combine classes when expected frequencies are less than 5. Show this clearly in your working — examiners look for it. After combining, recalculate the number of classes and adjust degrees of freedom.
A die is rolled 120 times with the following results:
| Face | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Observed | 15 | 23 | 18 | 25 | 17 | 22 |
H0: The die is fair (uniform distribution). Each face has probability 1/6.
Expected: E=120/6=20 for each face.
| Face | O | E | (O−E)2/E |
|---|---|---|---|
| 1 | 15 | 20 | 1.25 |
| 2 | 23 | 20 | 0.45 |
| 3 | 18 | 20 | 0.20 |
| 4 | 25 | 20 | 1.25 |
| 5 | 17 | 20 | 0.45 |
| 6 | 22 | 20 | 0.20 |
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.