Skip to content

Comparing two independent means

Test whether two independent groups differ in mean sales with the separate-variance t test, and read Excel's output for it.

It opens on

Shoreline's 12 new-layout stores average $56.00 per visit and its 10 standard stores average $45.80. Do the middle halves of the two groups overlap a lot, a little or not at all?

Why it matters

Managers compare two layouts, two suppliers or two campaigns, and need to say whether a gap between two sample means is real or just sampling noise.

Good to know first

  • sample mean, variance and standard deviation

Step by step

  1. Two groups and the question

    Set up the hypotheses for two independent means and see from the box plots and summaries why the groups appear to differ.

    A common mix-up

    If the sample means differ, the true means differ.

    In fact: Samples vary, so we must ask whether a gap this size is surprising when the true means are equal.

  2. The separate-variance (Welch) test

    Compute the standard error of the difference, the t statistic, the degrees of freedom and the p-value, and read them off Excel's output.

    s₁²/n₁ = 34.73 / 12 = 2.894 and s₂²/n₂ = 12.40 / 10 = 1.240, so SE = √(2.894 + 1.240) = √4.134 = 2.033.

    SE = √4.134 = 2.033

    A common mix-up

    The degrees of freedom are n₁ + n₂ − 2 = 20 for every two-sample test.

    In fact: That applies only when the variances are pooled, and the Welch test computes its own smaller value.

  3. The pooled test and the interval

    Compute the pooled t test, compare it with the Welch test, and build the interval for the difference.

    sp² = (11 × 34.73 + 9 × 12.40) / 20 = 24.68, so the standard error is √(24.68 × (1/12 + 1/10)) = 2.127, and t = 10.20 / 2.127 = 4.80 with 20 degrees of freedom.

    t = 10.20 / 2.127 = 4.80

    A common mix-up

    A significant difference means the groups differ by a large and useful amount.

    In fact: The interval shows the size, and a business must decide whether 6 to 14 dollars per visit is worth the cost of the layout.

Try it

A firm compares the same 8 salespeople's sales in March and April. Are these independent samples?Answer

No, the same people appear in both, so the samples are paired

Hint: Is each case linked to one in the other group?

Group 1 has mean 20, s² = 16, n = 8, and group 2 has mean 17, s² = 9, n = 6. Find SE and t.Answer

SE = √(2 + 1.5) = 1.871, t = 1.60

Hint: SE = √(s₁²/n₁ + s₂²/n₂)

A difference of means is 6, SE = 2.5 and t* = 2.1. Give the 95% interval and say whether 0 is inside.Answer

6 ± 5.25, so 0.75 to 11.25, 0 is not inside

Hint: Margin = t* × SE

The two sample means differ by 10.20 dollars. Does that alone show the true means differ?Answer

No, we must compare it with how much a difference of means varies by chance

What is the t statistic for a difference of 10.20 with SE 2.033?Answer

5.02

Comparing two independent means

30 minutes every month. No card.