Menu
Sign up Sign in

AI HL · 13.4

Hypothesis Testing

13.4.5

One-sample t-test for a mean

13.4.5

One-sample t-test for a mean

Target: I can state H0 and H1 for a one-sample test of a mean, define μ, and choose the tail from the wording. (+4 more)

By the end of this section

Key points

When to use a t-test

  • Use a t-test to test a claim about a population mean when the population variance is not known and is estimated from the sample.
  • The assumption is that the population is normally distributed. Write it down whenever you use the test.
  • H0 gives the old or claimed value of the mean only: H0: μ = μ0. It says nothing about the variance.

Hypotheses and tails

  • Define μ in words: 'μ g is the population mean mass of a loaf.'
  • H1 has the tail the question asks for. 'Increased', 'higher' or 'greater': μ > μ0. 'Decreased' or 'less': μ < μ0. 'Changed' or 'different': μ ≠ μ0.
  • H0 and H1 use μ, the population mean. Never write the sample mean in a hypothesis.

Carrying out the test

  • With a data list, enter the data and the value μ0. With summary statistics, enter the sample mean, the sample standard deviation s and n.
  • If you are given the estimate of the population variance, take its square root to get s.
  • The calculator gives t and the p-value for the tail you choose. For a two-tailed test, compare the p-value with the full significance level, not half of it.
  • Reject H0 if p < α. A p-value above α means insufficient evidence to reject H0.

Writing the conclusion

  • Always write it in context: "There is sufficient evidence, at the 5% significance level, that the mean … has increased."
  • If p > α say "insufficient evidence". Never write "H0 is true" or "proved".
  • A two-tailed test shows that the mean has changed. It does not say which way unless you look at the sample mean.

On the calculator

One-sample t-test from a data list

  • Enter the data in a list.
  • Choose the one-sample t-test, give μ0 and the tail from H1.
  • Read t and the p-value.

Screenshot and video to come

One-sample t-test from summary statistics

  • Choose the t-test with statistics instead of a data list.
  • Enter μ0, the sample mean, the sample standard deviation s and n.
  • If you are given a variance, enter its square root.
  • Read t and the p-value.

Screenshot and video to come

Explore: t-tests for means

Each dot is one value. Drag the orange marker under a sample to move it, and the teal point at the end of its bracket to change how spread out it is. The curve below is the t distribution: the orange area is the p-value.

Sample means
Estimates of σ
Pooled estimate, sₚ
Degrees of freedom
t
p-value for H₁:

The test assumes the population (for a paired test, the differences) is normally distributed; two samples also need equal variances. The markers move with the mouse, a finger, or the arrow keys once selected (Tab).

Drag a marker to start.

  1. Drag the orange marker until the sample mean equals the value in H₀ (or the two means are equal). What are t and the p-value? Why?
  2. Keep the means where they are and drag a teal point to make the sample less spread out. What happens to t and to the p-value? Why does the spread matter as much as the difference?
  3. Choose H₁ in the other direction from the sample. Why does the p-value become large?
  4. In Paired, each dot is one person's change. Why is testing these differences better than treating the before and after values as two samples?

Worked examples

Problems like the ones in class. Pick one, try it, then open the working.
An upper-tail test from a data list

A bakery says its loaves have a mean mass of 800 g. After a change of recipe the owner thinks the mean mass has increased. The masses of 8 randomly chosen loaves, in grams, are shown. Test at the 5% significance level. (a) State the hypotheses. (b) Find the t-statistic and the p-value. (c) State the conclusion in context. (d) State an assumption needed for this test.

Loaf12345678Mass (g)803811798806815801809812
Working
  1. Hypotheses

    H0: μ = 800, H1: μ > 800, where μ g is the population mean mass of a loaf.

    The owner thinks the mean has increased, so H1 has >. H0 gives the old value only.

  2. Enter the data

    From the calculator, one-sample t-test with μ0 = 800, upper tail: t = 3.30, p = 0.00655

    Put the 8 masses in a list. The calculator uses the sample's own standard deviation.

  3. Compare

    0.00655 < 0.05, so reject H0.

    Compare the p-value with the significance level, 0.05.

  4. In context

    There is sufficient evidence, at the 5% significance level, that the mean mass of a loaf has increased.

    The conclusion says what it means for the loaves.

  5. Assumption

    The masses of loaves are normally distributed.

    A t-test is only valid if the population is normal.

Video walkthrough coming
A lower-tail test from a data list

A battery maker says its batteries last a mean of 14.0 hours. A reviewer thinks the mean life is less. She tests 6 batteries and records the lives in hours. Test, at the 10% significance level, whether there is evidence that the mean life is less than 14.0 hours.

Battery123456Life (h)13.114.612.813.412.913.7
Working
  1. Hypotheses

    H0: μ = 14.0, H1: μ < 14.0

    The reviewer thinks the mean is less, so H1 has <.

  2. From the calculator

    One-sample t-test, lower tail: t = −2.14, p = 0.0426

    A negative t-statistic means the sample mean is below 14.0.

  3. Compare

    0.0426 < 0.1, so reject H0.

    Compare with the significance level, 0.10.

  4. In context

    There is sufficient evidence, at the 10% significance level, that the mean battery life is less than 14.0 hours.

    Write the conclusion about the batteries.

Video walkthrough coming
A two-tailed test at 2%

A machine is set to put 500 g of sugar in each bag. A worker thinks the mean mass has changed. The masses of 9 randomly chosen bags, in grams, are shown. Test, at the 2% significance level, whether the mean mass has changed.

Bag123456789Mass (g)498.9499.6497.4500.6496.8498.1499.7496.5498.0
Working
  1. Hypotheses

    H0: μ = 500, H1: μ ≠ 500

    'Changed' means up or down, so the test has two tails.

  2. From the calculator

    One-sample t-test, two-tailed: t = −3.43, p = 0.00892

    The calculator's p-value already includes both tails.

  3. Compare

    0.00892 < 0.02, so reject H0.

    Compare p with 0.02. Do not halve the significance level.

  4. In context

    There is sufficient evidence, at the 2% significance level, that the mean mass of a bag has changed from 500 g.

    Say the mean has changed. The sample mean is below 500 g, but a two-tailed test only shows a change.

Video walkthrough coming
A test from summary statistics

The 5 km times of the members of a running club are normally distributed with a mean of 31.5 minutes. After a training programme, a random sample of 16 members has a mean time of 29.8 minutes. The estimate of the population variance from the sample is 6.25. Test, at the 5% significance level, whether the mean time has changed.

Working
  1. Hypotheses

    H0: μ = 31.5, H1: μ ≠ 31.5

    The question asks if the mean has changed: two-tailed.

  2. Standard deviation

    s = √6.25 = 2.50

    The calculator needs the standard deviation, not the variance.

  3. Enter the statistics

    Summary statistics: x̄ = 29.8, s = 2.50, n = 16, μ0 = 31.5. From the calculator: t = −2.72, p = 0.0158

    Choose the t-test with statistics, not a data list.

  4. Compare

    0.0158 < 0.05, so reject H0.

    Compare with 0.05.

  5. In context

    There is sufficient evidence, at the 5% significance level, that the mean 5 km time has changed.

    Say what happened to the mean time.

Video walkthrough coming
Choosing the hypotheses

A tablet is advertised with a mean battery life of 10 hours. A reviewer thinks the real mean is less. She tests 12 tablets and finds a sample mean of 9.4 hours. State the null and alternative hypotheses for a one-sample t-test, defining μ.

Working
  1. Define μ

    Let μ hours be the population mean battery life of the tablets.

    Always say what μ stands for.

  2. H0

    H0: μ = 10

    H0 is the claim being tested. It uses the population mean, never the sample mean.

  3. H1

    H1: μ < 10

    The reviewer thinks the mean is less, so the test is lower-tail.

Video walkthrough coming