4.11 Hypothesis testing: chi-squared and t-tests
Studying this course? Keep your progress in one place.
Key facts
- A test compares the -value with the significance level: if level, reject .
- Never say is proved; say there is, or is not, enough evidence and answer in context.
- The test for independence uses and .
- The goodness of fit test uses when no parameters are estimated.
- The pooled -test compares two means: unpaired samples, normal data, equal variances.
Hypotheses and p-values
Compare the -value with the significance level: if is smaller, reject .
The null hypothesis is the claim being tested. The alternative hypothesis is what we accept if the evidence is strong enough: is two-tailed, or is one-tailed.
The significance level (often , or ) is the probability of rejecting when it is true. The p-value is the probability of a result at least as extreme as the one seen, if is true.
Conclude in context: "there is evidence that…" or "there is not enough evidence that…".
- 1
State H0 and H1
and the significance level
- 2
Calculate
the test statistic and p-value (GDC)
- 3
Compare
p with the significance level
- 4
Conclude in context
reject or do not reject H0
A test at the level gives . What is the correct decision?
Chi-squared test for independence
Compare observed counts with the counts expected if the variables were independent.
: the variables are independent. : they are associated.
Put the observed frequencies in a contingency table. The expected frequency of each cell is found from the totals, and the statistic is with degrees of freedom .
Reject if is above the critical value, or if the significance level. Use your GDC. Check that every expected frequency is greater than .
- Expected frequency
- Degrees of freedom
Worked example
Year travel and Year travel (walk, bus, car). Test for an association at .
- 1
: travel method and year are independent. : they are associated.
- 2
Column totals are , row totals are and , and the grand total is . So , then and in both rows.
- 3
. The GDC gives and .
- 4
, so do not reject .
A contingency table has rows and columns. How many degrees of freedom does the test have?
Chi-squared goodness of fit
Compare observed counts with the counts the distribution predicts; a large means a poor fit.
: the data fit the distribution (for example equally likely categories). : they do not.
Expected frequencies are the total times the probability of each category. For categories with no parameters estimated, the degrees of freedom are .
Then . Compare with the critical value, or compare with the significance level.
- Observed
- Expected
Worked example
customers choose among desserts: . Test at whether the choices are equally likely.
- 1
: choices are equally likely, so each expected frequency is .
- 2
and .
- 3
At the critical value is , and the GDC gives .
- 4
(and ), so reject .
A die is rolled times to test whether it is fair. What are the expected frequency and ?
The t-test for two means
The -test uses sample means to test whether two population means differ.
In examinations the samples are unpaired, the population variance is unknown and the variances are assumed equal, so the pooled two-sample t-test is used. Both populations must be normally distributed.
, with (two-tailed) or (one-tailed).
Enter the sample means, standard deviations and sizes into the GDC, choose the correct alternative, and compare the -value with the significance level.
| One-tailed | Two-tailed | |
|---|---|---|
| Alternative | ||
| Wording | "greater than", "less than" | "different from" |
| The p-value | Half the two-tailed value | Counts both tails |
One-tailed
- Alternative:
- Wording:
- "greater than", "less than"
- The p-value:
- Half the two-tailed value
Two-tailed
- Alternative:
- Wording:
- "different from"
- The p-value:
- Counts both tails
Worked example
Class A ( students, mean , standard deviation ) and class B ( students, mean , standard deviation ). Test at , then .
- 1
Enter the summary statistics into the GDC and choose the pooled two-sample -test.
- 2
One-tailed, : , so reject .
- 3
Two-tailed: , so do not reject .
A question asks whether the mean of one group is "different from" the other. Which alternative hypothesis do you use?
Interpreting results and limits
A significant result is evidence of an effect, not proof, and it says nothing about how large the effect is.
Compare with the given significance level: the same (for example ) can be significant at but not at .
- Expected frequencies of or less make a test unreliable, so combine categories.
- The -test needs normal populations with equal variances.
- A larger sample makes a real difference easier to detect.
Do not use a two-tailed test when only one direction was predicted in advance, and never change the level after seeing the result.
| Chi-squared test | t-test | |
|---|---|---|
| Needs | All expected frequencies above 5 | Normal data, equal variances |
| Unreliable when | An expected frequency is 5 or less | Skewed data or different variances |
Chi-squared test
- Needs:
- All expected frequencies above 5
- Unreliable when:
- An expected frequency is 5 or less
t-test
- Needs:
- Normal data, equal variances
- Unreliable when:
- Skewed data or different variances
Why might a test be unreliable?
Try an exam question
A test for independence is carried out on a contingency table at the significance level. The GDC gives . (a) State the hypotheses and the degrees of freedom. (b) State the conclusion in context, for a table of exam grade and revision method.
[4 marks]
- [1]: grade and revision method are independent; : they are associated.
- [1].
- [1], so reject .
- [1]There is evidence of an association between revision method and exam grade.
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