Chi-squared and t-tests
Hypothesis testing for IB Maths AI: null and alternative hypotheses, significance levels and p-values, the χ² test for independence with contingency tables and degrees of freedom, the χ² goodness of fit test, and the two-sample t-test with one- and two-tailed alternatives, all with GDC steps and conclusions in context.
mentorriyaz.in
In 30 seconds
- A hypothesis test starts from H0 (no effect, no difference, independent) and asks whether the data is unlikely enough to reject it.
- Decision rule: if the p-value < significance level (usually 5%), reject H0. Equivalently, reject if the test statistic is beyond the critical value.
- χ² test for independence: compare observed frequencies in a contingency table with the expected frequencies E = row total × column totalgrand total. Degrees of freedom = (rows − 1)(columns − 1).
- χ² goodness of fit: compare observed frequencies with those a model (uniform, binomial, normal) predicts. Degrees of freedom = number of categories − 1 (for the AI course, where no parameters are estimated).
- t-test: compares the means of two independent samples from normal populations. Use a one-tailed test when H1 says "greater" or "less", two-tailed for "different".
By the end you can
- Write null and alternative hypotheses, and understand significance levels and p-values.
- Find expected frequencies and degrees of freedom for a contingency table.
- Carry out and interpret a χ² test for independence.
- Carry out and interpret a χ² goodness of fit test.
- Carry out and interpret a t-test for the difference of two means, one- or two-tailed.
- Write conclusions in context.
1The language of hypothesis tests
| Term | Meaning |
|---|---|
| H0 | null hypothesis: no association, no difference |
| H1 | alternative hypothesis: what you suspect |
| significance level | the probability of rejecting H0 when it is true (5% unless told) |
| p-value | the probability of a result at least this extreme if H0 is true |
| critical value | the boundary of the rejection region for the test statistic |
2χ² test for independence
| Maths | Science | Arts | Total | |
|---|---|---|---|---|
| Year 11 | 30 | 25 | 15 | 70 |
| Year 12 | 20 | 35 | 25 | 80 |
| Total | 50 | 60 | 40 | 150 |
Test at the 5% level whether favourite subject is independent of year group.
- H0: favourite subject and year group are independent; H1: they are not independent A1
- expected Year 11 Maths = 70 × 50150 = 23.3, …; df = (2 − 1)(3 − 1) = 2 M1A1
- GDC χ² test: χ² = 5.52, p = 0.0631 A1
- 0.0631 > 0.05, so do not reject H0: there is not enough evidence at 5% that favourite subject depends on year group R1
3χ² goodness of fit
A die is rolled 60 times: 1 (8), 2 (12), 3 (9), 4 (7), 5 (14), 6 (10). Test at 5% whether it is fair.
- H0: the die is fair (each face has probability 16); H1: it is not fair A1
- expected 10 each, df = 6 − 1 = 5 A1
- χ² = 4 + 4 + 1 + 9 + 16 + 010 = 3.40, p = 0.639 M1A1
- p > 0.05 (and 3.40 < critical value 11.07): do not reject H0; there is no evidence the die is biased R1
- Other models: for "the data follows B(4, 0.5)" or a normal model, find the expected frequencies from the model × total, then test in the same way.
4The t-test for two means
Class A scored 72, 68, 75, 80, 66, 71, 77 and class B scored 65, 70, 62, 68, 64, 71, 60. Test at the 5% level whether class A's mean is greater. Assume normal populations with equal variances.
- H0: μA = μB; H1: μA > μB (one-tailed) A1
- 2-sample t-test, pooled: x̄A = 72.7, x̄B = 65.7, t = 2.88, p = 0.00697 M1A1
- p < 0.05, so reject H0: there is evidence that class A's mean score is higher R1
- Two-tailed: for H1: μA ≠ μB, the p-value doubles (here 0.0139), and you compare with 5% in the same way.
- Assumptions: both samples random and independent, both populations normally distributed. Mention them if asked to comment on the validity of the test.
Test yourself — cover the answers first
Quick check
- What does H₀ say in a test for independence?
- Find df for a 3 × 4 contingency table.
- p = 0.03 at the 5% level. Decision?
- Expected frequency: row total 40, column total 30, grand total 120.
- Which H₁ gives a one-tailed t-test: "different" or "greater"?
Exam-style
- In a goodness of fit test with 4 categories, χ²calc = 9.2 and the 5% critical value for 3 df is 7.815. State and justify your conclusion.
- A contingency table has an expected frequency of 3.2 in one cell. What should you do, and why?
Show answers
- the two variables are independent
- 6
- reject H₀
- 10
- greater
- 9.2 > 7.815, so χ² is in the critical region
reject H₀: there is evidence at the 5% level that the data does not fit the model - expected frequencies should be at least 5 for the χ² test to be valid
combine that row or column with an adjacent one, then recalculate the degrees of freedom before testing
Send it to me on WhatsApp. I read every message.
Want regular help? Send this to your parent →