IB Mathematics: Applications and Interpretation · Topic 4 · Statistics and probability
4.11 Chi-squared and t-tests
Describe the purpose of chi-squared and t-tests, carry out each test with technology, and interpret p-values and conclusions in context.
1/5Hypothesis tests judge whether a pattern could be chance
- Hypothesis tests judge whether a pattern could be chance
- A chi-squared test compares observed counts with expected counts
- Technology carries out the chi-squared test from a table
- A t-test compares the means of two groups
- A small p-value is evidence against the null hypothesis
- Check your recall
- Practice: 10 questions
Part 1 of 5: Hypothesis tests judge whether a pattern could be chance
A school survey finds that more Year 13 students cycle than Year 12 students. Samples vary, so a difference in a sample may be due to chance. A hypothesis test decides whether the evidence is strong enough to rule chance out.
The null hypothesis, , states that there is no difference or no association. The alternative hypothesis, , states that there is one. The p-value measures how surprising the data would be if were true.
We compare the p-value with a significance level, usually 5%. A chi-squared test looks for association between categories. A t-test compares the means of two groups.
Key terms · tap one for its definition
null hypothesis
The null hypothesis is the default statement of no difference or no association, which a test looks for evidence against.
p-value
The p-value is the probability of obtaining results at least as extreme as those observed, assuming the null hypothesis is true.
significance level
The significance level is the chosen threshold, often 5%, below which a p-value leads us to reject the null hypothesis.
Part 2 of 5: A chi-squared test compares observed counts with expected counts
Start with counts of people in categories. A contingency table shows these observed counts for two categorical variables. The test asks whether the variables are independent.
If the variables were independent, each cell would have an expected frequency. This is found from the totals in the table.
The hypotheses are : the variables are independent, and : they are associated. The test statistic is where is an observed count and an expected count.
The degrees of freedom are for a table with rows and columns. Technology uses this number to find the p-value.
Key terms · tap one for its definition
contingency table
A contingency table is a table of observed counts for two categorical variables, with a row or column for each category.
expected frequency
An expected frequency is the count a cell would have if the variables were independent, equal to .
degrees of freedom
The degrees of freedom of a chi-squared test is the number of counts free to vary, given by for rows and columns.

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: A · Worked explanation
Part 3 of 5: Technology carries out the chi-squared test from a table
Now apply the test to real data. A school records how students travel. We test at the 5% significance level whether transport choice is independent of year group.
Enter the observed counts as a matrix on the calculator. It returns , the degrees of freedom, the p-value and the matrix of expected counts. Check those expected counts before trusting the result.
Observed travel counts
- Year 12
- Bus
- 30
- Car
- 20
- Total
- 50
- Year 13
- Bus
- 20
- Car
- 30
- Total
- 50
- Total
- Bus
- 50
- Car
- 50
- Total
- 100
Worked example
Transport and year group
- : transport and year group are independent. : they are associated.
- Expected frequency for each cell: .
- , and degree of freedom.
- Technology gives .
- Compare: .
Answer: Reject . There is evidence of an association between year group and transport choice.
Part 4 of 5: A t-test compares the means of two groups
Now suppose the data are measurements rather than counts. A t-test compares the mean of one group with the mean of another. It assumes that both groups are independent and roughly normal, with similar spread.
Here states that the two population means are equal. Enter each data set into technology and choose the two-sample test with pooled variance. The output gives , the degrees of freedom and the p-value.
Worked example
Fertiliser and plant height
- : the means are equal. : the means differ.
- The sample means are 16 cm for X and 20 cm for Y.
- Technology gives in magnitude, with 8 degrees of freedom.
- The p-value is , and .
Answer: Reject . There is evidence that the mean height is greater with fertiliser Y.
Write the sample means before the conclusion. Then say which group has the higher mean, since a significant result alone does not say which.
Key term
t-test
A t-test is a hypothesis test that compares the means of two groups of numerical data, assuming both come from normal populations.

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: A · Worked explanation
Part 5 of 5: A small p-value is evidence against the null hypothesis
The decision rule is the same for both tests. If the p-value is less than the significance level, reject . If it is greater, do not reject . Choose the significance level before looking at the p-value. Always finish with a sentence in context.
Comparing the two tests
- Feature
- Data type
- Chi-squared test
- Counts in categories
- t-test
- Numerical measurements
- Feature
- Compares
- Chi-squared test
- Observed and expected counts
- t-test
- Two group means
- Feature
- states
- Chi-squared test
- Variables are independent
- t-test
- The means are equal
The p-value is not the probability that is true. It is the probability of results at least as extreme as ours if is true.
Check your recall[14 marks]
6 written questions. Answer each one in your head or on paper, then open the mark scheme.
- 1.State[2 marks]
State the null and alternative hypotheses for a chi-squared test for independence.
Show mark schemeHide mark scheme
Model answer
: the two variables are independent. : the two variables are associated.
- 1 mark for stating the null hypothesis as independence
- 1 mark for stating the alternative hypothesis as association
- 2.Calculate[2 marks]
A contingency table has a row total of 60, a column total of 40 and a grand total of 200. Calculate the expected frequency of the cell where they meet.
Show mark schemeHide mark scheme
Model answer
.
- 1 mark for using row total times column total divided by grand total
- 1 mark for obtaining 12
- 3.Determine[2 marks]
Determine the degrees of freedom for a chi-squared test on a table with 3 rows and 4 columns.
Show mark schemeHide mark scheme
Model answer
.
- 1 mark for using
- 1 mark for obtaining 6
- 4.Deduce[3 marks]
A chi-squared test for independence between gender and choice of club gives . Deduce the conclusion at the 5% significance level, in context.
Show mark schemeHide mark scheme
Model answer
Since 0.03 is less than 0.05, reject the null hypothesis. There is evidence of an association between gender and choice of club.
- 1 mark for comparing 0.03 with 0.05
- 1 mark for rejecting the null hypothesis
- 1 mark for concluding in context that gender and club choice are associated
- 5.Distinguish[3 marks]
Distinguish between the purposes of a chi-squared test for independence and a t-test.
Show mark schemeHide mark scheme
Model answer
A chi-squared test for independence uses counts in categories to test for association between two categorical variables. A t-test uses numerical data to compare the means of two groups.
- 1 mark for stating that a chi-squared test uses categorical counts
- 1 mark for stating that it tests for association or independence
- 1 mark for stating that a t-test compares the means of two groups
- 6.Explain[2 marks]
Explain why a large p-value should lead to the conclusion “do not reject ” rather than “accept ”.
Show mark schemeHide mark scheme
Model answer
A large p-value shows only that the data are consistent with the null hypothesis. It does not prove that the null hypothesis is true.
- 1 mark for stating that a large p-value shows the evidence is not strong enough against
- 1 mark for stating that this does not prove true

Practice this topic
10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)
0 right0 of 10 answered
Includes the 2 quick checks in the note above.
EasyIdentify[1 mark]
Show answer and explanation
Answer: A · Worked explanation
MediumCalculate[1 mark]
Show answer and explanation
Answer: A · Worked explanation
MediumDeduce[1 mark]
Show answer and explanation
Answer: A · Worked explanation
MediumCalculate[1 mark]
Show answer and explanation
Answer: A · Worked explanation
MediumDeduce[2 marks]
Show answer and explanation
Answer: A · Worked explanation
HardCalculate[2 marks]
Show answer and explanation
Answer: A · Worked explanation
HardDeduce[2 marks]
Show answer and explanation
Answer: A · Worked explanation
HardIdentify[2 marks]
Show answer and explanation
Answer: A · Worked explanation