Two-sample z-test for difference in proportions
Two-Sample z-Test for Difference in Proportions
The two-sample z-test for the difference in proportions is a statistical hypothesis test used to compare the proportions of a certain characteristic in two independent populations or groups. This test is appropriate when you have categorical data and are interested in whether a statistically significant difference exists between two population proportions, denoted as p₁ and p₂.
When to Use This Test
- Comparing the success rate of a new drug versus a placebo.
- Determining if the proportion of voters favoring a candidate differs between two regions.
- Assessing if the proportion of defective items differs between two production lines.
Hypotheses
The test involves formulating a null hypothesis (H₀) and an alternative hypothesis (Hₐ or Hₐ). The null hypothesis always states that there is no difference between the two population proportions, while the alternative hypothesis suggests a difference.
- Null Hypothesis (H₀): p₁ = p₂ (or p₁ - p₂ = 0) - There is no difference between the two population proportions.
- Alternative Hypothesis (Hₐ):
- p₁ ≠ p₂ (two-tailed test) - There is a difference.
- p₁ < p₂ (left-tailed test) - Proportion 1 is less than Proportion 2.
- p₁ > p₂ (right-tailed test) - Proportion 1 is greater than Proportion 2.
Conditions for Inference
Before conducting a two-sample z-test for proportions, several conditions must be met:
- Random Condition: The data must come from two independent random samples or from two groups in a randomized experiment. This ensures representativeness and independence.
- 10% Condition: When sampling without replacement, both sample sizes (n₁ and n₂) must be less than 10% of their respective population sizes. This ensures the independence of observations within each sample.
- Large Counts Condition (Success/Failure Condition): The expected number of successes and failures must be at least 10 for both groups. That is, n₁p̂₁ ≥ 10, n₁(1-p̂₁) ≥ 10, n₂p̂₂ ≥ 10, and n₂(1-p̂₂) ≥ 10. For hypothesis testing, under the null hypothesis (p₁=p₂), we use the pooled proportion (p̂ᶜ) for this check: n₁p̂ᶜ ≥ 10, n₁(1-p̂ᶜ) ≥ 10, n₂p̂ᶜ ≥ 10, and n₂(1-p̂ᶜ) ≥ 10. The large counts condition ensures that the sampling distribution of the difference in sample proportions is approximately normal.
Test Statistic Formula
The test statistic for the two-sample z-test for the difference in proportions is calculated as:
$$z = \frac{(\hat{p}_1 - \hat{p}_2) - (p_1 - p_2)}{\sqrt{\hat{p}_c(1-\hat{p}_c)(\frac{1}{n_1} + \frac{1}{n_2})}}$$
Where:
- ̂p₁ and ̂p₂ are the sample proportions from the two groups.
- p₁ - p₂ is the hypothesized difference in population proportions, which is usually 0 under H₀.
- n₁ and n₂ are the sample sizes.
- ̂pᶜ is the pooled sample proportion (also known as the combined proportion), calculated as: ̂pᶜ = (x₁ + x₂) / (n₁ + n₂), where x₁ and x₂ are the number of successes in each sample. We pool the proportions because, under the null hypothesis, we assume the true population proportions are equal, so it makes sense to combine the data to estimate this common proportion.
After calculating the z-test statistic, you compare it to a critical value from the standard normal distribution or use it to find a p-value. The p-value helps determine whether to reject or fail to reject the null hypothesis at a chosen significance level (α).
Practice questions
What is the primary purpose of conducting a two-sample z-test for the difference in proportions?
Why is the 'Large Counts Condition' important for a two-sample z-test for proportions?
Under what circumstance would you use a pooled sample proportion (̂pᶜ) in the standard error calculation for a two-sample z-test?
A researcher wants to know if the proportion of students who prefer online learning is different between two different universities. What would be the appropriate null hypothesis for this study?
Related topics
Free AP4U account — unlimited practice, AI grader, and progress tracking.
Canonical: https://apforu.com/ap/statistics/unit-6-inference-for-categorical-data-proportions/two-sample-z-test-for-difference-in-proportions