Further Statistics 1 (Paper 3B or 4B), topic 6 (Chi-squared tests), spec point 6.1
The test statistic
Compare observed frequencies with the frequencies expected under :
Under this is approximately , where is the number of degrees of freedom. A large value means a poor fit, so the test is always upper-tailed.
Combining cells
The approximation needs every . If any expected frequency is less than 5, combine it with a neighbouring cell before counting degrees of freedom.
Goodness of fit
: the data can be modelled by the stated distribution. : they cannot.
For example, fitting a Poisson distribution with estimated from the sample mean loses one extra degree of freedom. The distributions you may test include discrete uniform, binomial, Poisson and geometric.
Worked example 1: is a die fair?
A die is rolled 120 times.
| Score | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| 15 | 25 | 18 | 22 | 16 | 24 | |
| 20 | 20 | 20 | 20 | 20 | 20 |
, and the 5% critical value is . Since , do not reject : there is no evidence the die is biased.
Contingency tables
: the two factors are independent. : they are not independent.
Worked example 2
Students choose a lunch option.
| A | B | C | Total | |
|---|---|---|---|---|
| Year 12 | 30 | 20 | 10 | 60 |
| Year 13 | 20 | 25 | 15 | 60 |
| Total | 50 | 45 | 25 | 120 |
Expected frequencies are , and in each row. Then with . The 5% critical value is , so there is no evidence that lunch choice depends on year group.
Using a calculator
You can find the -value on your calculator instead of using tables: reject if it is less than the significance level.
Common mistake: counting degrees of freedom before combining cells, or forgetting to subtract one for each parameter estimated from the data.
Exam tip: lay out a table of , and . Show any combining of cells clearly, state and the critical value, and conclude in context.
Check yourself
Seven cells remain after combining, and a binomial was estimated from the data. Find .
.
Find for a contingency table.
.
Why is the chi-squared test upper-tailed?
Only large values of show a poor fit; a small value means the data agree well with .