Study Guide

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.

πŸ“˜ Definition

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.

βœ“ Quick check

Check your understanding of when to use t-procedures:

  1. 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.

  2. 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

πŸ“˜ Definition

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.

πŸ“ Worked Example

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. 1

    State the null and alternative hypotheses:

  2. 2
    H0:ΞΌ=12,H1:ΞΌβ‰ 12H_0: \mu = 12, \quad H_1: \mu \neq 12
  3. 3

    Calculate degrees of freedom and test statistic: . The test statistic formula is:

  4. 4
    t=xΛ‰βˆ’ΞΌ0s/nt = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}
  5. 5

    Substitute the sample values:

  6. 6
    t=12.3βˆ’121.8/10β‰ˆ0.527t = \frac{12.3 - 12}{1.8/\sqrt{10}} \approx 0.527
  7. 7

    Find the two-tailed p-value for , :

  8. 8

    Conclude: Since , we fail to reject . There is insufficient evidence at 5% significance that the true mean height differs from 12m.

πŸ“ Worked Example

Calculate a 95% confidence interval for the true mean height of the oak trees from the sample above.

  1. 1

    The formula for a confidence interval for when is unknown is:

  2. 2
    xΛ‰Β±tβˆ—sn\bar{x} \pm t^* \frac{s}{\sqrt{n}}
  3. 3

    Where is the critical t-value for the given confidence level and . For 95% confidence, , .

  4. 4

    Calculate the margin of error:

  5. 5
    ME=2.262Γ—1.810β‰ˆ1.29ME = 2.262 \times \frac{1.8}{\sqrt{10}} \approx 1.29
  6. 6

    Construct the interval:

  7. 7
    (11.01,13.59)(11.01, 13.59)
  8. 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

πŸ“˜ Definition

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.

πŸ“ Worked Example

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. 1

    Let be the true mean difference (before after). State hypotheses:

  2. 2
    H0:ΞΌd=0,H1:ΞΌd>0H_0: \mu_d = 0, \quad H_1: \mu_d > 0
  3. 3

    Degrees of freedom:

  4. 4

    Calculate test statistic:

  5. 5
    t=dΛ‰βˆ’0sd/n=3.22.8/8β‰ˆ3.23t = \frac{\bar{d} - 0}{s_d/\sqrt{n}} = \frac{3.2}{2.8/\sqrt{8}} \approx 3.23
  6. 6

    Find the one-tailed p-value for , :

  7. 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

πŸ“˜ Definition

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.

πŸ“ Worked Example

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. 1

    State hypotheses, where = true mean score for Class A, = true mean score for Class B:

  2. 2
    H0:ΞΌBβˆ’ΞΌA=0,H1:ΞΌBβˆ’ΞΌA>0H_0: \mu_B - \mu_A = 0, \quad H_1: \mu_B - \mu_A > 0
  3. 3

    For IB AI HL, degrees of freedom is the minimum of :

  4. 4

    Test statistic formula for difference in means:

  5. 5
    t=(xΛ‰Bβˆ’xΛ‰A)βˆ’0sA2nA+sB2nBt = \frac{(\bar{x}_B - \bar{x}_A) - 0}{\sqrt{\frac{s_A^2}{n_A} + \frac{s_B^2}{n_B}}}
  6. 6

    Substitute values:

  7. 7
    t=(76βˆ’72)8215+7212β‰ˆ1.395t = \frac{(76 - 72)}{\sqrt{\frac{8^2}{15} + \frac{7^2}{12}}} \approx 1.395
  8. 8

    One-tailed p-value for , :

  9. 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.