4.11 Hypothesis testing: chi-squared and t-tests
Studying this course? Keep your progress in one place.
Key facts
- Reject if the -value is less than the significance level; otherwise do not reject.
- Never say is proved or accepted: say there is, or is not, enough evidence.
- independence: and .
- Goodness of fit: and .
- The pooled two-sample -test compares two means, assuming normal populations with equal variances.
Hypotheses and p-values
A test asks whether sample data give enough evidence against the null hypothesis, judged by the -value.
The null hypothesis is the claim being tested; the alternative hypothesis is accepted if there is enough evidence against (two-tailed with , one-tailed with or ).
The significance level is the probability of rejecting when it is true (1%, 5% or 10%). The -value is the probability of a result at least as extreme as observed, if is true.
If significance level, reject ; otherwise do not reject . Conclude in context.
- 1
State H0 and H1
in context
- 2
Choose the significance level
as given in the question
- 3
Use the GDC
to find the test statistic and p-value
- 4
Compare
p with the significance level
- 5
Conclude in context
reject or do not reject H0
at the 5% level. The decision is...
Chi-squared test for independence
Compare observed with expected frequencies in a contingency table.
The test for independence tests whether two categorical variables are associated. : independent. : associated.
Data are a contingency table of observed frequencies . The expected frequency is , and with degrees of freedom .
Tables have at most 4 rows or columns and . Use the GDC. Only upper-tail tests are used: reject if exceeds the critical value, or the level.
- Expected
- Degrees of freedom
Worked example
Year travel (walk, bus, car): . Year travel: . Test for an association at the level.
- 1
: travel method is independent of year group. : they are associated.
- 2
Column totals are and the grand total is . Each row total is .
- 3
Expected values for each row: , , .
- 4
The degrees of freedom are .
- 5
The GDC gives and .
A 3 by 4 contingency table has how many degrees of freedom?
Chi-squared goodness of fit
Compare observed frequencies with those expected if the data followed the stated distribution.
The goodness of fit test tests whether data fit a stated distribution. : the data fit (for example, equally likely categories). : they do not.
Find expected frequencies as total probability of each category. At SL the degrees of freedom for categories are . Then ; compare with the critical value, or with the level.
- Observed
- Expected
- Expectedtotal probability
- Degrees of freedom
Worked example
customers choose among desserts: . Test at whether the desserts are equally likely to be chosen.
- 1
: choices are equally likely. : they are not.
- 2
Each expected frequency is .
- 3
.
- 4
. At the critical value is .
5 categories in a goodness of fit test.
The t-test for two means
The pooled two-sample -test checks whether two population means differ.
The -test uses sample means to test whether two population means differ. In examinations the samples are unpaired, the population variance is unknown and you assume equal variances, so the pooled two-sample -test is used on your GDC. Both populations must be normally distributed.
, with (two-tailed) or (one-tailed). Enter the means, standard deviations and sizes and choose the correct alternative; the GDC returns and .
| Two-tailed | One-tailed | |
|---|---|---|
| or | ||
| Wording | "different from" | "greater than" |
Two-tailed
- :
- Wording:
- "different from"
One-tailed
- :
- or
- Wording:
- "greater than"
Worked example
Class A ( students, mean , standard deviation ) and class B ( students, mean , standard deviation ). Test at whether class A has a higher mean.
- 1
and (one-tailed).
- 2
Use the pooled two-sample -test on the GDC with the means, standard deviations and sizes.
- 3
The GDC gives .
"Is the mean different from 50?" calls for a...
Interpreting results
A significant result is evidence, not proof; the assumptions of each test must hold.
Write conclusions in context and compare with the given significance level: the same can be significant at 10% but not at 5% (for example ).
- A significant result is evidence of an effect, not proof, and says nothing about its size or importance.
- For tests, expected frequencies of 5 or less make the test unreliable; categories may need combining.
- The -test needs normal populations with equal variances.
- A larger sample makes it easier to detect a real difference.
Do not use a two-tailed test when only one direction was predicted in advance, and do not change the level after seeing the result.
| Chi-squared | t-test | |
|---|---|---|
| Needs | Expected frequencies all above 5 | Normal populations, equal variances |
| Data | Categorical data | Numerical data |
Chi-squared
- Needs:
- Expected frequencies all above 5
- Data:
- Categorical data
t-test
- Needs:
- Normal populations, equal variances
- Data:
- Numerical data
A significant result shows...
Try an exam question
A die is rolled times with results for to of . Test at the level whether the die is fair. The critical value for is .
[4 marks]
- [1]: the die is fair; : it is not fair.
- [1]Expected frequency for each face is .
- [1] with .
- [1], so do not reject : no evidence that the die is not fair.
That's the notes covered.
Carry on to the next subtopic.
Try a question
Write down the number of degrees of freedom for the test.
1 mark, marked against the mark scheme
Write down the number of degrees of freedom for the test.
1 mark, marked against the mark scheme