Menu
Sign up Sign in

AI HL · 13.4

Hypothesis Testing

13.4.12

Two-sample tests for means: z and pooled t

13.4.12

Two-sample tests for means: z and pooled t

Target: I can state H0: μ1 = μ2 and H1 for a two-sample test, defining μ1 and μ2 in words. (+4 more)

By the end of this section

Key points

Which test

  • Two independent samples, and both population standard deviations σ1 and σ2 known: use the two-sample z-test. It does not matter whether σ1 and σ2 are equal.
  • Population standard deviations not known, assumed equal: use the two-sample pooled t-test, as in the earlier lesson on the pooled t-test. The standard deviations you are given are sample values.
  • Both tests assume the populations are normal. The t-test also assumes equal variances.

Hypotheses

  • H0: μ1 = μ2. H1: μ1 ≠ μ2, μ1 > μ2 or μ1 < μ2, from the wording.
  • Define μ1 and μ2 in words, and keep group 1 as the group named first in the claim.

Carrying out the test

  • From summary statistics for a z-test, enter σ1 and σ2, the sample means and the sample sizes. For a t-test, enter the sample means, the sample standard deviations s and the sample sizes, and choose pooled.
  • From data, enter the two lists. A z-test also needs σ1 and σ2.
  • Choose the tail that matches H1. Read the p-value. For a two-tailed test compare it with the full significance level.

Concluding

  • If p < α, reject H0: there is sufficient evidence, at the α significance level, that the means differ (or that μ1 is greater, or less).
  • If p > α, do not reject H0: there is insufficient evidence. Never write that the means are equal.
  • The conclusion must name both populations, in context, and agree with H1 and the p-value.

On the calculator

Two-sample z-test from statistics

  • Choose the two-sample z-test with statistics.
  • Enter σ1, σ2, the two sample means and the two sample sizes. Choose the tail from H1.
  • Read z and the p-value.

Screenshot and video to come

Two-sample z-test from lists

  • Enter each sample in its own list.
  • Choose the two-sample z-test with data. Enter σ1 and σ2 and choose the tail from H1.
  • Read z and the p-value.

Screenshot and video to come

Two-sample pooled t-test

  • Choose the two-sample t-test, from statistics or from lists.
  • Choose pooled, and the tail from H1.
  • 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.
Writing the hypotheses

A dietician claims that adults who eat breakfast have a lower mean resting heart rate than adults who skip it. Random samples of each group are taken. State the null and alternative hypotheses, defining each mean.

Working
  1. Define the means

    μ1 = population mean resting heart rate of adults who eat breakfast; μ2 = population mean resting heart rate of adults who skip it

    Group 1 is the group named first in the claim. Always say in words what each mean is.

  2. Null hypothesis

    H0: μ1 = μ2

    H0 says there is no difference between the two population means.

  3. Alternative hypothesis

    H1: μ1 < μ2

    'Lower' for group 1 is one-tailed. 'Different' would be μ1 ≠ μ2.

Video walkthrough coming
Known σ: summary statistics

Two machines cut portions of cheese. The masses, in grams, are normally distributed with known standard deviations of 3.1 g for machine 1 and 2.6 g for machine 2. A random sample of 15 portions from machine 1 has mean mass 48.2 g. A random sample of 20 portions from machine 2 has mean mass 49.9 g. Test, at the 5% significance level, whether machine 1 cuts lighter portions on average.

Working
  1. Hypotheses

    μ1, μ2: population mean mass of a portion from machine 1, machine 2. H0: μ1 = μ2, H1: μ1 < μ2

    'Lighter' for machine 1 gives a lower tail.

  2. Choose the test

    Two-sample z-test, because both σ are known

    The standard deviations are population values, not estimates from the samples.

  3. From the calculator

    Two-sample z-test from statistics: σ1 = 3.1, n1 = 15, x̄1 = 48.2, σ2 = 2.6, n2 = 20, x̄2 = 49.9, μ1 < μ2: z = −1.72, p = 0.0429

    Enter the σ values as given. The test does not pool anything.

  4. Conclusion

    0.0429 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that machine 1 cuts lighter portions on average.

    Compare p with 0.05 and answer in context.

Video walkthrough coming
Known σ: data lists

Two driving routes are timed, in minutes. The journey times on each route are normally distributed with standard deviation 1.5 minutes. Route A: 24.1, 26.3, 25.2, 27.0, 25.8, 26.4. Route B: 23.5, 24.8, 25.1, 23.9, 25.6, 24.2, 24.7. Test, at the 10% significance level, whether route A takes longer on average. Find the p-value.

Working
  1. Hypotheses

    μ1, μ2: population mean time on route A, route B. H0: μ1 = μ2, H1: μ1 > μ2

    'Takes longer' is an upper tail.

  2. From the calculator

    Two-sample z-test from lists: list 1 = route A, list 2 = route B, σ1 = 1.5, σ2 = 1.5, μ1 > μ2: z = 1.51, p = 0.0660

    With lists you enter σ yourself. The calculator finds the sample means.

  3. Conclusion

    0.0660 < 0.1, so reject H0. There is sufficient evidence, at the 10% significance level, that route A takes longer on average.

    At the 10% level the evidence is enough. At 5% it would not be.

Video walkthrough coming
Unknown σ: summary statistics

A biologist compares the heights of two varieties of plant. A random sample of 11 plants of variety 1 has mean height 23.4 cm and standard deviation 2.6 cm. A random sample of 13 plants of variety 2 has mean height 25.9 cm and standard deviation 3.0 cm. Heights are normally distributed with equal variances. Find the p-value for a test of whether the mean heights differ.

Working
  1. Hypotheses

    H0: μ1 = μ2, H1: μ1 ≠ μ2

    'Differ' means two tails.

  2. Choose the test

    Two-sample t-test, pooled

    The population σ are unknown and assumed equal. The 2.6 and 3.0 are sample standard deviations, so this is a t-test.

  3. From the calculator

    Two-sample t-test from statistics, pooled: x̄1 = 23.4, s1 = 2.6, n1 = 11, x̄2 = 25.9, s2 = 3.0, n2 = 13, μ1 ≠ μ2: t = −2.16, p = 0.0419

    The p-value already covers both tails.

Video walkthrough coming
A full test from two lists

The lifetimes, in hours, of a sample of 7 batteries of brand A and 8 batteries of brand B are shown. Brand A: 312, 298, 325, 301, 310, 290, 305. Brand B: 330, 321, 318, 335, 309, 326, 340, 322. Lifetimes are normally distributed with equal variances. Test, at the 5% significance level, whether brand A batteries last less long on average.

Working
  1. Hypotheses

    μ1, μ2: population mean lifetime of brand A, brand B. H0: μ1 = μ2, H1: μ1 < μ2

    'Last less long' is a lower tail.

  2. From the calculator

    Two-sample t-test from lists, pooled, μ1 < μ2: t = −3.54, p = 0.00182

    Put brand A in list 1 and brand B in list 2, so that the tail matches H1.

  3. Conclusion

    0.00182 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the mean lifetime of brand A batteries is less than that of brand B.

    Name both brands in the conclusion. State the assumption of normality and equal variances if asked.

Video walkthrough coming