Chi-squared goodness of fit testsEdexcel International A Level Further Maths: Revision notes
Section 1
The idea and the hypotheses
A goodness of fit test asks whether observed data could reasonably have come from a stated model, such as a discrete or continuous uniform, binomial, Poisson or Normal distribution. : the model fits the data (for example, 'the number of breakdowns follows a Poisson distribution'). : the model does not fit the data. The test is always one-tailed: only a large value of the test statistic counts as evidence against the model. Write the hypotheses about the whole distribution, not about a single parameter.
Writing : or : . In a goodness of fit test the hypotheses are about the whole distribution.
Section 2
The test statistic
For each cell, compare the observed frequency with the expected frequency given by the model: If is true, is approximately distributed. A small value means the data are close to the model; a large value means they are far from it. Under the model , and the expected frequencies must add up to the total frequency . Yates' correction is not required.
Check that before you calculate . If not, a probability or the last cell is wrong.
Section 3
Finding expected frequencies for each distribution
Discrete uniform (a fair die, throws): every cell has . For example, 120 throws gives per face. Continuous uniform on : a class of width has probability . Waiting times uniform on 0 to 20 minutes in four classes of width 5 give each. Binomial : . If is not given, estimate it as . Poisson : , and estimate by the sample mean. Make the last cell ' or more', with of the others. Normal : , found by standardising with . The two end classes extend to .
Treating the sample mean of grouped Normal data as if it were given. It is an estimate, and it costs a degree of freedom.
Section 4
Combining cells
The approximation is only reliable if every expected frequency is at least 5. If any , combine it with a neighbouring cell, adding both the expected and the observed frequencies, and repeat until every . For a Poisson model the small cells are usually in the tail, so combine into ' or more'. Check the combined value: with and the total is still below 5, so a third cell must be added. The number of cells used in the degrees of freedom is the number after combining.
Combining the observed frequencies only, or checking instead of .
Section 5
Degrees of freedom
where is the number of cells after combining and is the number of parameters estimated from the data. One degree of freedom is lost because the total of the expected frequencies is fixed. No parameters estimated (a die, a uniform distribution with given limits, a fully specified binomial, Poisson or Normal): . Binomial with estimated, or Poisson with estimated: . Normal with and both estimated: .
Write with the actual numbers; method marks are given for showing what and were.
Section 6
Carrying out the test, and contingency tables
- State and .
- Find the expected frequencies and combine cells where .
- Calculate .
- State and the critical value of at the stated significance level, from the tables.
- Reject if is greater than the critical value; otherwise there is insufficient evidence to reject it. Conclude in context. Example: a die gives frequencies 14, 25, 17, 22, 24, 18 in 120 throws. , , and the 5% critical value is . Since , there is no evidence that the die is unfair. The same statistic is used to test contingency tables, covered later in this unit.
Writing 'accept ' as if it were proved. Write 'insufficient evidence to reject , so the model is a suitable fit'.
That's the notes covered.
Carry on to the next subtopic.
Exam questions on Chi-squared goodness of fit tests
- A die is thrown 120 times. Faces 1 to 6 occurred 14, 25, 17, 22, 24 and 18 times respectively. A goodness of fit test is to be used to test whether the die is fair.Calculate the value of the test statistic .2 marks
- A firm records the number of machine breakdowns in each of 100 weeks. No breakdowns occurred in 27 weeks, 1 in 35 weeks, 2 in 22 weeks, 3 in 11 weeks, 4 in 4 weeks and 5 in 1 week. The mean number of breakdowns per week is 1.33. The firm models the weekly number of breakdowns by a Poisson distribution with mean 1.33. The expected frequencies are 26.45, 35.18, 23.39, 10.37, 3.45 and 1.17 for 0, 1, 2, 3, 4 and 5 or more breakdowns respectively.Calculate the value of the test statistic for the combined cells.2 marks
- An inspector tests 120 boxes, each containing 4 bulbs, and records the number of defective bulbs in each box. There were 48 boxes with no defective bulbs, 42 with 1, 22 with 2, 7 with 3 and 1 with 4. The inspector suggests that the number of defective bulbs in a box can be modelled by , with estimated from the data.State suitable hypotheses and show that the estimate of is 0.231 to 3 significant figures.3 marks
Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).