Theoretical Background: Confidence Interval for Two Proportions
A confidence interval for the difference between two population proportions (\(p_1 - p_2\)) provides an estimated range of values that is likely to include the true difference. This is used to compare the proportions of a characteristic of interest in two independent groups (e.g., comparing the effectiveness of two treatments, or the preference for a product between two demographics).
Key Inputs and Point Estimates
- Group 1:
- \(x_1\): Number of "successes" in sample 1.
- \(n_1\): Total sample size of group 1.
- Group 2:
- \(x_2\): Number of "successes" in sample 2.
- \(n_2\): Total sample size of group 2.
- \(\alpha\): The significance level (e.g., 0.05 for a 95% confidence interval).
The point estimates for the individual population proportions are the sample proportions:
The point estimate for the difference between the two population proportions is \( \hat{p}_1 - \hat{p}_2 \).
1. Wald Interval for the Difference (Normal Approximation Method)
The Wald interval is a traditional method based on the normal approximation. It works reasonably well when sample sizes are large and proportions are not too close to 0 or 1 for both groups.
The standard error of the difference between two sample proportions is estimated as:
The confidence interval is then calculated as:
Where \(Z_{\alpha/2}\) is the critical value from the standard normal distribution (e.g., for 95% CI, \(Z_{0.025} \approx 1.96\)).
Conditions for Normal Approximation: For the Wald interval to be reliable, it's generally recommended that \(n_1\hat{p}_1 \ge 10\), \(n_1(1-\hat{p}_1) \ge 10\), \(n_2\hat{p}_2 \ge 10\), and \(n_2(1-\hat{p}_2) \ge 10\). If these conditions are not met, the Wald interval can be inaccurate.
2. Agresti-Caffo Interval (Adjusted Wald Method)
The Agresti-Caffo interval is an adjustment to the Wald method that provides better performance, especially for smaller sample sizes or when proportions are near 0 or 1. It involves adding pseudo-observations (1 success and 1 failure) to each sample before calculating the proportions and standard error.
First, calculate adjusted counts and sample sizes:
Then, calculate the adjusted sample proportions:
The standard error for the Agresti-Caffo interval uses these adjusted proportions and sample sizes:
The Agresti-Caffo confidence interval is then:
The Agresti-Caffo interval is generally recommended due to its improved coverage properties compared to the standard Wald interval for differences in proportions.
Interpreting the Confidence Interval for \(p_1 - p_2\)
A \( (1-\alpha) \times 100\% \) confidence interval for \(p_1 - p_2\) is interpreted as: "We are \( (1-\alpha) \times 100\% \) confident that the true difference between the population proportion for group 1 (\(p_1\)) and the population proportion for group 2 (\(p_2\)) lies between the lower and upper bounds of the interval."
- If the interval contains 0, there is no statistically significant evidence (at the \(\alpha\) level) of a difference between the two population proportions.
- If the interval is entirely positive (both bounds > 0), it suggests \(p_1 > p_2\).
- If the interval is entirely negative (both bounds < 0), it suggests \(p_1 < p_2\).