Introduction: Comparing Two Worlds

In statistics, we often want to know if two groups are different. For example: Is a new vaccine more effective than the old one? Do people in London prefer a certain brand more than people in Manchester? When we are dealing with "yes/no" outcomes (successes and failures), we are looking at binomial proportions.

In this chapter, we learn how to conduct a parametric test to see if the difference between two proportions is statistically significant or just due to random chance. Don't worry if this seems tricky at first—once you see the pattern, it's very similar to other hypothesis tests you've already met!

What are we testing?

We are comparing two independent populations. We take a sample from each and look at the proportion of "successes" in each.

  • Population 1: True proportion \(\pi_1\), sample size \(n_1\), observed successes \(x_1\).
  • Population 2: True proportion \(\pi_2\), sample size \(n_2\), observed successes \(x_2\).

Our sample proportions are calculated as \(p_1 = \frac{x_1}{n_1}\) and \(p_2 = \frac{x_2}{n_2}\).

The Hypotheses

In a standard test for the difference between two proportions, we usually start by assuming there is no difference.

Null Hypothesis (\(H_0\)): \(\pi_1 = \pi_2\) (The proportions are the same).

Alternative Hypothesis (\(H_1\)): This depends on what we are looking for:
- Two-tailed: \(\pi_1 \neq \pi_2\)
- One-tailed: \(\pi_1 > \pi_2\) or \(\pi_1 < \pi_2\)

Key Takeaway

We use the Greek letter \(\pi\) (or sometimes \(p\)) for the population parameter and the Latin letter \(p\) (or \(\hat{p}\)) for the sample statistic.

The "Pooled" Estimate: Joining Forces

Under the Null Hypothesis (\(H_0\)), we assume that \(\pi_1\) and \(\pi_2\) are actually the same value. If they are the same, it makes sense to "pool" our data together to get the best possible estimate of this common proportion.

The pooled proportion (\(p_p\)) is calculated by adding all the successes and dividing by the total number of trials:

\(p_p = \frac{x_1 + x_2}{n_1 + n_2}\)

Analogy: Imagine two bags of marbles. Instead of looking at them separately, if we believe they have the same mix of colors, we just tip them both into one big bucket to get a better overall count.

The Test Statistic

To decide whether to reject \(H_0\), we calculate a \(z\)-statistic. This tells us how many standard errors the observed difference \((p_1 - p_2)\) is away from the expected difference (which is \(0\) under \(H_0\)).

The formula provided in your Statistical Formulae and Tables booklet is:

\(z = \frac{p_1 - p_2}{\sqrt{p_p(1 - p_p)(\frac{1}{n_1} + \frac{1}{n_2})}}\)

Where:
- \(p_1\) and \(p_2\) are individual sample proportions.
- \(p_p\) is the pooled proportion.
- \(n_1\) and \(n_2\) are the sample sizes.

Did you know? This test relies on the Normal Approximation. For this to be valid, the samples need to be large enough. A common rule of thumb is that there should be at least 10 successes and 10 failures in each group (i.e., \(np > 10\) and \(n(1-p) > 10\)).

Step-by-Step: How to Conduct the Test

Step 1: State the hypotheses clearly.
Example: \(H_0: \pi_1 = \pi_2\) and \(H_1: \pi_1 \neq \pi_2\).

Step 2: Calculate the sample proportions.
Find \(p_1 = \frac{x_1}{n_1}\) and \(p_2 = \frac{x_2}{n_2}\).

Step 3: Calculate the pooled proportion (\(p_p\)).
\(p_p = \frac{x_1 + x_2}{n_1 + n_2}\).

Step 4: Calculate the \(z\) test statistic.
Plug your values into the formula. Be careful with your square roots and brackets on the calculator!

Step 5: Determine the Critical Value or p-value.
Use your calculator or the Normal distribution tables (usually at the 5% level unless stated otherwise).
- For a two-tailed test at 5%, the critical values are \(\pm 1.96\).

Step 6: Make a conclusion.
Compare your \(z\) value to the critical value.
- If \(|z| > \text{critical value}\), reject \(H_0\).
- Crucial: Always write your final conclusion in context. Instead of just "Reject \(H_0\)", say "There is significant evidence to suggest that the proportion of people who prefer Brand A is different from Brand B."

Common Mistakes to Avoid

  • Forgetting to pool: Some students try to use the individual variances for each proportion. For a hypothesis test where we assume the proportions are equal, you must use the pooled estimate.
  • Mixing up \(x\) and \(n\): Remember that \(n\) is the total sample size and \(x\) is the number of "successes". \(x\) can never be larger than \(n\).
  • Notation: Using \(\bar{x}\) instead of \(p\). Proportions are about counts, not means of continuous data.
Quick Review

When do I use this? When you have two independent groups and you are comparing "success rates" or percentages.

What distribution do I use? The Standard Normal distribution (\(z\)).

What is the core assumption? That the samples are random and large enough for the normal approximation to hold.

Real-World Example

A clinical trial tests two hay fever medications. In Group 1, 80 out of 100 people felt better. In Group 2, 92 out of 120 people felt better. Is there a significant difference at the 5% level?

1. Hypotheses: \(H_0: \pi_1 = \pi_2\), \(H_1: \pi_1 \neq \pi_2\).
2. Proportions: \(p_1 = 0.80\), \(p_2 = 0.767\).
3. Pooled Proportion: \(p_p = \frac{80 + 92}{100 + 120} = \frac{172}{220} \approx 0.7818\).
4. Test Statistic:
\(z = \frac{0.80 - 0.767}{\sqrt{0.7818(1 - 0.7818)(\frac{1}{100} + \frac{1}{120})}}\)
\(z \approx \frac{0.033}{0.056} \approx 0.59\).
5. Comparison: \(0.59 < 1.96\).
6. Conclusion: We fail to reject \(H_0\). There is no significant evidence to suggest the two medications have different success rates.