Introduction to Comparing Two Means

In your statistics journey so far, you have learned how to test if a single sample mean differs from a population mean. But what if we want to compare two different groups? For example, does a new fertilizer actually make plants grow taller than the old one? Do students in School A perform better on average than students in School B?

This chapter focuses on the difference of two means when we already know the variances of the populations we are studying. This is a parametric test, meaning it relies on specific assumptions about the underlying distribution of our data.

When to Use This Test

Before you start crunching numbers, you must ensure this is the correct test to use. For the Two-Sample z-test (difference of two means with known variances), the following conditions must be met:

  • Independent Samples: The two groups must be independent of each other (e.g., measuring the heights of two different groups of people, not the same people before and after a treatment).
  • Known Variances: You must know the population variances \( \sigma_1^2 \) and \( \sigma_2^2 \). In exam questions, these are usually given explicitly.
  • Normal Distributions: The populations should be normally distributed. However, thanks to the Central Limit Theorem, if your sample sizes \( n_1 \) and \( n_2 \) are large (usually \( n \ge 30 \)), the test is still valid even if the underlying populations aren't perfectly normal.

Quick Tip: If you don't know the variances and have to estimate them from the samples, you should likely be using a "Pooled t-test" instead!

The Distribution of the Difference

To compare two means, we look at the difference between the sample means: \( \bar{X}_1 - \bar{X}_2 \).

From the syllabus (Section 12), we know that for independent variables, the expected value (mean) of the difference is the difference of the means:

\( E(\bar{X}_1 - \bar{X}_2) = \mu_1 - \mu_2 \)

Crucially, even though we are subtracting the means, the variances always add up. The variance of the difference between the two sample means is:

\( Var(\bar{X}_1 - \bar{X}_2) = \frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2} \)

Therefore, our sampling distribution is:

\( (\bar{X}_1 - \bar{X}_2) \sim N\left(\mu_1 - \mu_2, \frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}\right) \)

The Hypothesis Testing Process

Follow these steps to conduct the test. Don't worry if it seems like a lot at first; it follows the same logic as every other hypothesis test you've done!

1. State the Hypotheses

The Null Hypothesis (\( H_0 \)) usually assumes there is no difference between the means:

\( H_0: \mu_1 = \mu_2 \) (or \( \mu_1 - \mu_2 = 0 \))

The Alternative Hypothesis (\( H_1 \)) depends on what you are trying to prove:

  • Two-tailed: \( H_1: \mu_1 \neq \mu_2 \) (there is a difference)
  • One-tailed (upper): \( H_1: \mu_1 > \mu_2 \) (the first mean is greater)
  • One-tailed (lower): \( H_1: \mu_1 < \mu_2 \) (the first mean is smaller)

2. Calculate the Test Statistic (\( z \))

The \( z \)-statistic measures how many standard errors our observed difference (\( \bar{x}_1 - \bar{x}_2 \)) is away from the hypothesized difference (usually \( 0 \)). You can find this formula in your Statistical Formulae and Tables booklet:

\( z = \frac{(\bar{x}_1 - \bar{x}_2) - (\mu_1 - \mu_2)}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}} \)

Since we assume \( \mu_1 - \mu_2 = 0 \) under \( H_0 \), the formula simplifies to:

\( z = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}} \)

3. Find the Critical Value or P-value

Using your calculator or the normal distribution tables, find the critical value for your chosen significance level (usually \( 5\% \)).

  • For a two-tailed test at \( 5\% \), the critical values are \( \pm 1.96 \).
  • For a one-tailed test at \( 5\% \), the critical value is \( 1.6449 \) (or \( -1.6449 \)).

4. Make a Decision and Interpret

If \( |z| > \text{critical value} \): Reject \( H_0 \). There is significant evidence to suggest a difference between the means.

If \( |z| < \text{critical value} \): Fail to reject \( H_0 \). There is insufficient evidence to suggest a difference.

Remember: Always write your final conclusion in the context of the original question!

Example Scenario

A lightbulb manufacturer claims Brand A lasts longer than Brand B. Brand A has a known population standard deviation of \( \sigma_1 = 80 \) hours. Brand B has \( \sigma_2 = 60 \) hours. A sample of \( 40 \) Brand A bulbs has a mean life of \( 1050 \) hours, while \( 50 \) Brand B bulbs have a mean life of \( 1020 \) hours. Test the claim at the \( 5\% \) level.

Step 1: \( H_0: \mu_A = \mu_B \); \( H_1: \mu_A > \mu_B \) (One-tailed test).

Step 2: Calculate \( z \):

\( z = \frac{1050 - 1020}{\sqrt{\frac{80^2}{40} + \frac{60^2}{50}}} = \frac{30}{\sqrt{160 + 72}} = \frac{30}{15.23} \approx 1.97 \)

Step 3: Critical value for one-tailed \( 5\% \) is \( 1.6449 \).

Step 4: Since \( 1.97 > 1.6449 \), we reject \( H_0 \). There is significant evidence to support the claim that Brand A bulbs last longer than Brand B bulbs.

Common Mistakes to Avoid

  • Forgetting to Square Standard Deviations: The formula requires variances (\( \sigma^2 \)). If the question gives you the standard deviation (\( \sigma \)), make sure you square it!
  • Confusing \( \sigma \) and \( s \): This specific test is for known population variances (\( \sigma^2 \)). If you only have sample variances (\( s^2 \)), you should check if a t-test is required.
  • Adding Variances: Even if the hypothesis is about a difference (\( \bar{X}_1 - \bar{X}_2 \)), you add the variance terms in the denominator. Variation always increases when you combine independent variables.

Key Takeaways

1. Context: Use this test for two independent groups when population variances are known.
2. The Statistic: The denominator is the standard error of the difference: \( \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}} \).
3. Normality: If samples are small, the populations must be normal. If samples are large (\( n \ge 30 \)), the Central Limit Theorem allows us to use this test anyway.
4. Conclusion: Always relate your statistical result back to the real-world problem provided in the exam.

Note: For cases where variances are unknown but assumed equal, see the chapter on the Two-sample pooled t-test. For cases where data is paired, see Paired tests.