Chi Squared Tests
Revise Chi Squared Tests for Further Mathematics — revision notes and instant AI marking. Free to start.
Chi Squared Tests
📋 Summary — What This Chapter Covers
- Goodness of fit — comparing observed data (O) to expected data (E) predicted by a model, and testing if the model is any good.
- The test statistic X² — a single number measuring how "off" your observed values are from expected.
- Degrees of freedom (ν) — how many values were actually "free to vary" once totals and estimated parameters are accounted for.
- Testing against standard distributions — discrete uniform, binomial, Poisson, geometric — each with its own way of finding expected frequencies and degrees of freedom.
- Contingency tables — a two-way version of the same idea, testing whether two variables are independent of each other.
- Throughout: the golden rule that every expected value must be ≥ 5, or you must combine categories.
1. Goodness of Fit
Observed vs Expected
Think of it like this: you have a theory about how something behaves (a "model"), and you have real data from actually doing the thing. Goodness of fit measures how well the real data matches your theory.
Classic example — you flip a coin 20 times assuming it's fair. Your model (theory) says you should expect 10 heads. In reality, you observe 13 heads. Is 13 "close enough" to 10 to still believe the coin is fair? That's exactly the question a chi-squared test answers.
We lay observed values (Oᵢ) and expected values (Eᵢ) out in a table, one column per possible outcome. A really important check: the observed total and expected total must always match —
Hypotheses
Every chi-squared goodness of fit test starts the same way:
H₁ (alternative): The observed distribution cannot be modelled by the expected distribution (the model is NOT a good fit).
All chi-squared tests are one-tailed — you're only ever asking "is X² too big?", never "too big or too small."
Calculating the Test Statistic
Step 1 — combine columns. Before you calculate anything, check every expected value. If any Eᵢ is less than 5, you must merge that column with a neighbouring one until the combined expected value is 5 or more. This matters because the chi-squared approximation breaks down with small expected frequencies.
| Score | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| Oᵢ | 15 | 6 | 4 | 1 |
| Eᵢ | 12 | 8 | 4 | 2 |
Columns 3 and 4 have expected values below 5, so combine them:
| Score | 1 | 2 | 3+ |
|---|---|---|---|
| Oᵢ | 15 | 6 | 5 |
| Eᵢ | 12 | 8 | 6 |
Step 2 — calculate X². There are two equivalent formulas — use whichever is faster for the numbers you have:
The bigger X² is, the more the observed data disagrees with the model.
Degrees of Freedom (ν)
This trips up almost everyone at first, so here's the intuition: degrees of freedom = how many category values could genuinely vary freely before the rest are forced by constraints.
- Start with: (number of columns after combining) − 1. You subtract 1 because once you know all-but-one of the expected values, the last one is forced — it must make the totals match (∑Eᵢ = ∑Oᵢ).
- If you ALSO had to use the observed data to estimate a parameter (like estimating p for a binomial, or λ for a Poisson), subtract 1 more for each parameter estimated.
Making the Decision
Once you have X² and ν, compare X² against a critical value χ²ᵥ(α%) from tables, using your significance level α%.
2. Chi Squared Tests for Standard Distributions
The overall process (hypotheses → expected values → degrees of freedom → X² → critical value → conclusion) never changes. What changes between distributions is how you calculate the expected frequencies and whether you had to estimate a parameter. Here's each one broken down.
Discrete Uniform
Every outcome is equally likely: P(X=x) = 1/k for k possible values. There's never a parameter to estimate here — the model is fully defined just by knowing k.
Binomial
Needs: fixed number of trials n, independent trials, two outcomes (success/failure), constant probability p.
Sometimes you're given p (e.g. testing B(n, 0.2) directly). Other times you must estimate it from the data:
Poisson
Needs: independent events, singly & randomly occurring, constant rate, mean = variance.
Poisson variables run from 0 to infinity — so your first and last categories need special handling:
- The smallest observed value a: calculate P(X ≤ a) for that column.
- The largest observed value b: calculate P(X ≥ b) = 1 − P(X ≤ b−1) for that column (this "catches" the infinite tail).
Geometric
Needs: independent trials, two outcomes, repeated until first success, constant p. The variable counts the number of trials until first success — so it runs from 1 to infinity.
3. Chi Squared Tests for Contingency Tables
What's Different Here?
So far we've tested "does this ONE variable follow a particular shape?" Contingency tables ask a different question: "are these TWO variables independent of each other, or related?" For example: is favourite music genre independent of listener age group, or do older listeners really prefer different genres?
This is still a goodness of fit test underneath — you're testing whether the data fits the assumption of independence. A table with h rows and k columns (not counting total rows/columns) is called an h × k contingency table.
Expected Frequencies
Same rule as before: if any expected value is below 5, combine the corresponding row or column with an adjacent one — choosing whichever combination makes the most logical sense in context (e.g. merging two similar age brackets rather than merging two very different genres).
Degrees of Freedom
Hypotheses & Conclusion
H₁: Variable X and Variable Y are not independent.
Same decision rule as always: X² > critical value (or p < α) → reject H₀ → the variables are not independent. Otherwise → insufficient evidence to reject → the variables are independent.
🧠 What to Memorise
✅ Concepts Checklist
🎯 Exam Tips & Common Mistakes
- 🎯 Exam Tips & Common Mistakes
- Hypotheses & Conclusion
Read the full Chi Squared Tests notes free
That's the preview — create a free account to read the rest, plus flashcards and practice questions with instant AI marking. No credit card.
Unlock the full notes free →