Welcome to Chi-Squared (\(\chi^2\)) Tests
Welcome to one of the most practical and widely used areas of statistics in your CCEA A2 Further Mathematics (Unit A2 2: Section C) course! Have you ever wondered how scientists determine whether a new medical treatment works, or how researchers test if a rolling die is genuinely fair? They use Chi-squared (\(\chi^2\)) hypothesis tests.
In simple terms, a Chi-squared test compares what we actually observed in an experiment against what we expected to happen under a theoretical model. If the gap between reality and theory is small, we put it down to natural random chance. But if that gap is huge, we have strong evidence that our theoretical model is wrong!
Don't worry if hypothesis testing has felt overwhelming in the past. We will break down every single step into clear, bite-sized stages so you can score full marks on exam day.
1. The Core Idea: Observed vs Expected
Every Chi-squared test relies on two sets of values for each category:
1. Observed Frequencies (\(O_i\)): The actual counts collected from sample data.
2. Expected Frequencies (\(E_i\)): The counts we would theoretically expect if the null hypothesis (\(H_0\)) were completely true.
The Test Statistic Formula
To measure the total discrepancy between reality and theory, we calculate the calculated Chi-squared test statistic, denoted as \(\chi_{\text{calc}}^2\):
\(\chi_{\text{calc}}^2 = \sum \frac{(O_i - E_i)^2}{E_i}\)
An alternative, algebraically identical formula that can speed up calculations is:
\(\chi_{\text{calc}}^2 = \sum \frac{O_i^2}{E_i} - N\)
where \(N = \sum O_i = \sum E_i\) represents the total sample size.
Why square the difference? Just like calculating standard deviation, squaring \((O_i - E_i)\) ensures that positive and negative differences don't cancel each other out! Dividing by \(E_i\) scales each category relative to its size.
2. The Golden Rule: Minimum Expected Frequency (\(E_i \ge 5\))
The Chi-squared distribution is a smooth, continuous theoretical curve used to approximate discrete frequency counts. For this approximation to remain valid, examiners strictly enforce the Rule of 5:
Every expected frequency must be at least 5 (\(E_i \ge 5\)).
What if an expected frequency is less than 5?
If any \(E_i < 5\), you must pool (combine) that class with an adjacent class (or adjacent row/column) before computing \(\chi_{\text{calc}}^2\).
Crucial Exam Rule: Always calculate all \(E_i\) values first. Check for any \(E_i < 5\), combine the corresponding observed and expected cells, and only then calculate \(\chi_{\text{calc}}^2\) and the degrees of freedom.
3. Application 1: Contingency Tables (\(r \times c\))
A contingency table is used when we want to test whether two categorical variables (like gender and subject choice, or age group and preferred transport) are independent or whether there is an association between them.
Step 1: State the Hypotheses
CCEA requires clear, contextual hypotheses:
\(H_0\): There is no association between Factor A and Factor B (i.e. the variables are independent).
\(H_1\): There is an association between Factor A and Factor B (i.e. the variables are not independent).
Step 2: Calculate Expected Frequencies
For a table with \(r\) rows and \(c\) columns, the expected frequency for the cell in row \(i\) and column \(j\) is:
\(E_{ij} = \frac{(\text{Row } i \text{ Total}) \times (\text{Column } j \text{ Total})}{\text{Grand Total } N}\)
Step 3: Check the Rule of 5
Ensure all \(E_{ij} \ge 5\). If not, pool adjacent rows or columns.
Step 4: Degrees of Freedom (\(\nu\))
For an \(r \times c\) contingency table, the degrees of freedom (\(\nu\)) is given by:
\(\nu = (r - 1)(c - 1)\)
Note: If you had to combine rows or columns to satisfy \(E_{ij} \ge 5\), use the number of rows and columns after pooling.
4. Application 2: Goodness of Fit Tests
A Goodness of Fit test checks whether a sample of data comes from a specific theoretical distribution.
General Rule for Degrees of Freedom in Goodness of Fit
The number of degrees of freedom \(\nu\) measures the number of independent pieces of information remaining:
\(\nu = k - 1 - m\)
where:
• \(k\) = number of classes/categories after pooling
• \(1\) is subtracted because the total frequency \(N\) is fixed (\(\sum E_i = \sum O_i\))
• \(m\) = number of distribution parameters estimated from the sample data
Common Theoretical Distributions:
1. Discrete Uniform / Specified Ratio Model:
• All probabilities are fixed in advance (no parameters estimated, \(m = 0\)).
• \(\nu = k - 1\)
2. Binomial Distribution (\(B(n, p)\)):
• If \(p\) is given in the question: \(m = 0 \implies \nu = k - 1\).
• If \(p\) is estimated from the sample data (\(\hat{p} = \frac{\bar{x}}{n}\)): \(m = 1 \implies \nu = k - 1 - 1 = k - 2\).
3. Poisson Distribution (\(\text{Po}(\lambda)\)):
• If \(\lambda\) is specified: \(m = 0 \implies \nu = k - 1\).
• If \(\lambda\) is estimated from the sample mean (\(\hat{\lambda} = \bar{x}\)): \(m = 1 \implies \nu = k - 1 - 1 = k - 2\).
4. Normal Distribution (\(N(\mu, \sigma^2)\)):
• If \(\mu\) and \(\sigma^2\) are both specified: \(m = 0 \implies \nu = k - 1\).
• If \(\mu\) is estimated: \(m = 1 \implies \nu = k - 2\).
• If both \(\mu\) and \(\sigma^2\) are estimated from the sample: \(m = 2 \implies \nu = k - 1 - 2 = k - 3\).
5. The Complete 5-Step Hypothesis Testing Framework
Whenever you tackle a Chi-squared question on your exam, follow this foolproof step-by-step checklist:
Step 1: Formulate Hypotheses
State \(H_0\) and \(H_1\) clearly in the context of the question.
Step 2: Calculate Expected Frequencies & Check \(E_i \ge 5\)
Find all \(E_i\). If any \(E_i < 5\), combine adjacent classes/cells and update your table.
Step 3: Calculate the Test Statistic
Compute \(\chi_{\text{calc}}^2 = \sum \frac{(O_i - E_i)^2}{E_i}\).
Step 4: Determine Degrees of Freedom & Find Critical Value
Identify \(\nu\) (using classes after pooling and accounting for estimated parameters \(m\)). Look up the critical value \(\chi_{\text{crit}}^2\) at the given significance level \(\alpha\) (commonly \(5\%\) or \(1\%\)) from statistical tables.
Step 5: Compare and Conclude
• If \(\chi_{\text{calc}}^2 > \chi_{\text{crit}}^2\), we reject \(H_0\).
• If \(\chi_{\text{calc}}^2 \le \chi_{\text{crit}}^2\), we do not reject \(H_0\).
How to Write the Final Conclusion (CCEA Marking Convention)
CCEA examiners insist on non-assertive, contextualised wording. Never write "This proves that the data is Poisson" or "Factor A definitely causes Factor B".
Use standard statistical phrasing such as:
"There is sufficient evidence at the \(5\%\) level of significance to suggest an association between..."
or
"There is insufficient evidence at the \(5\%\) significance level to suggest that the data does not follow a Binomial distribution."
6. Common Exam Pitfalls to Avoid
• Forgetting to Pool: Always check every single expected value. If one is \(4.99\), you must combine it with an adjacent class.
• Using Pre-Pooling \(k\) for Degrees of Freedom: Remember that \(\nu\) uses the number of classes after pooling.
• Missing the Parameter Penalty: If you had to calculate the sample mean \(\bar{x}\) to find \(\lambda\) or \(p\), remember to subtract \(1\) additional degree of freedom for each estimated parameter.
• Overly Definitive Language: Always maintain statistical caution: use words like "evidence to suggest" rather than "proves".
Key Takeaways Summary
• Test Statistic: \(\chi_{\text{calc}}^2 = \sum \frac{(O_i - E_i)^2}{E_i} = \sum \frac{O_i^2}{E_i} - N\)
• Minimum Cell Condition: All \(E_i \ge 5\). Pool adjacent classes if needed.
• Contingency Tables: \(E_{ij} = \frac{\text{Row Total} \times \text{Col Total}}{N}\) with \(\nu = (r - 1)(c - 1)\).
• Goodness of Fit: \(\nu = k - 1 - m\) (where \(m\) is the number of estimated parameters).
• Decision Rule: Reject \(H_0\) if \(\chi_{\text{calc}}^2 > \chi_{\text{crit}}^2\), and write your conclusion with non-assertive, contextual wording.