t-tests and confidence intervals for means
IB Mathematics: Applications and Interpretation HLΒ· 8 min read
1. The t-distribution and when to use t-proceduresβ β ββββ± 15 min
When performing inference for a population mean , z-procedures are only valid if we know the true population standard deviation . In almost all real research and IB exam problems, is unknown, so we use the t-distribution instead of the standard normal (z) distribution.
Student's t-distribution
A symmetric, bell-shaped distribution that accounts for additional uncertainty from estimating with the sample standard deviation . It has heavier tails than the z-distribution to avoid underestimating p-values and margin of error.
Example:
A sample of size 10 has degrees of freedom for a one-sample t-procedure.
Check your understanding of when to use t-procedures:
You know the true population standard deviation , should you use a t-test or z-test?
t-test
z-test
Reveal answer
1 βCorrect! Z-tests are appropriate when is known.
is unknown, you only have the sample standard deviation , should you use a t-test or z-test?
t-test
z-test
2. One-sample t-test and confidence interval for $\mu$β β β βββ± 25 min
One-sample t-test
A hypothesis test for the value of a single unknown population mean, used when the population standard deviation is unknown.
Example:
Testing whether the average weight of a cereal box is different from the advertised 500g.
A botanist measures the heights of 10 young oak trees, getting a sample mean of 12.3m and sample standard deviation of 1.8m. Test at 5% significance whether the true mean height is different from 12m.
- 1
State the null and alternative hypotheses:
- 2
- 3
Calculate degrees of freedom and test statistic: . The test statistic formula is:
- 4
- 5
Substitute the sample values:
- 6
- 7
Find the two-tailed p-value for , :
- 8
Conclude: Since , we fail to reject . There is insufficient evidence at 5% significance that the true mean height differs from 12m.
Calculate a 95% confidence interval for the true mean height of the oak trees from the sample above.
- 1
The formula for a confidence interval for when is unknown is:
- 2
- 3
Where is the critical t-value for the given confidence level and . For 95% confidence, , .
- 4
Calculate the margin of error:
- 5
- 6
Construct the interval:
- 7
- 8
Interpretation: We are 95% confident that the true mean height of the oak trees lies between 11.01m and 13.59m.
3. Paired t-tests for matched dataβ β β βββ± 20 min
Paired t-test
A hypothesis test for the mean difference in dependent paired data, such as before/after measurements on the same subjects, or matched pairs of individuals. We reduce paired data to a single sample of differences and perform a one-sample t-test on the differences.
Example:
Testing whether a new allergy medication reduces average symptom score.
8 participants had their resting heart rate measured before and after a 4-week walking program. The mean difference (before after) is 3.2 bpm, with a sample standard deviation of differences of 2.8 bpm. Test at 10% significance whether the program reduces mean resting heart rate.
- 1
Let be the true mean difference (before after). State hypotheses:
- 2
- 3
Degrees of freedom:
- 4
Calculate test statistic:
- 5
- 6
Find the one-tailed p-value for , :
- 7
Conclude: Since , we reject . There is sufficient evidence at 10% significance that the walking program reduces mean resting heart rate.
4. Independent two-sample t-tests for difference in meansβ β β β ββ± 25 min
Independent two-sample t-test
A hypothesis test for the difference between the means of two independent populations, when both population standard deviations are unknown.
Example:
Comparing the average exam scores of students taught with two different teaching methods.
A teacher compares test scores of 15 students from Class A (, ) and 12 students from Class B (, ). Test at 5% significance whether the true mean score of Class B is higher than Class A.
- 1
State hypotheses, where = true mean score for Class A, = true mean score for Class B:
- 2
- 3
For IB AI HL, degrees of freedom is the minimum of :
- 4
Test statistic formula for difference in means:
- 5
- 6
Substitute values:
- 7
- 8
One-tailed p-value for , :
- 9
Conclude: Since , we fail to reject . There is insufficient evidence at 5% significance that Class B has a higher true mean score.
5. Common Pitfalls
Wrong move:
Using a z-test instead of t-test when is unknown
Why:
The z-distribution does not account for extra uncertainty from estimating with , leading to p-values that are too small
Correct move:
Always use t-procedures for means when is unknown, which is almost always the case in IB exams
Wrong move:
Using an unpaired t-test for paired dependent data
Why:
Unpaired tests ignore the matching in paired data, wasting information and leading to incorrect p-values
Correct move:
Calculate differences for each pair and run a one-sample t-test on the sample of differences
Wrong move:
Interpreting a 95% confidence interval as 'there is a 95% probability the true mean is in this interval'
Why:
The true mean is a fixed constant, not random: it is either inside or outside the interval. 95% refers to the method of constructing intervals
Correct move:
Interpret as 'We are 95% confident that the true mean lies between the lower and upper bound'
Wrong move:
Using for unpaired t-tests in IB AI HL
Why:
IB AI HL requires the conservative estimate of for unpaired two-sample t-tests
Correct move:
Always take the smaller of to get the correct degrees of freedom for exam grading
Wrong move:
Forgetting to state the conclusion in context
Why:
Most IB exam questions require a contextual conclusion to get full marks for hypothesis test questions
Correct move:
Always link your conclusion back to the original problem scenario after deciding to reject or fail to reject
6. Quick Reference Cheatsheet
Procedure | Degrees of Freedom | Test Statistic |
|---|---|---|
One-sample t-test | ||
Paired t-test | ( = number of pairs) | |
Independent t-test | ||
CI for |
When this came up on past exams
AI-estimated based on syllabus patterns β cross-check with official past papers for accuracy. Use only as revision-focus signals.
- 2025 Β· 2
8 mark paired t-test hypothesis test
- 2024 Β· 1
6 mark confidence interval calculation
- 2023 Β· 2
Independent two-sample t-test question
What's Next
t-tests and confidence intervals for means are core inferential tools that form the foundation for almost all parametric statistics used in research, business, and the social sciences. Mastery of these procedures is essential for high marks on the IB AI HL exam, and will prepare you for university-level statistics courses regardless of your field of study. Next, you will apply t-procedures to inference for linear regression parameters, where we test whether the slope of a regression line is significantly different from zero. You will also learn about chi-square tests for categorical data and non-parametric alternatives for when the normality assumption of t-procedures is violated.
