1.5 Comparing two independent proportions | Inferential Statistics | Comparing two groups | UvA
Summary
Highlights
This section introduces the Z-test for two proportions, used to compare two independent groups on a categorical binary variable. It also covers the calculation of the corresponding confidence interval. Examples of research questions for this test include comparing smoking rates between men and women or epilepsy prevalence between different regions.
The Z-test for two proportions requires independent samples, randomly assigned or drawn cases, and sufficient observations. For one-sided tests, at least 10 positive and 10 negative cases in each sample are needed. For two-sided tests and confidence intervals, at least 5 positive and 5 negative cases in each sample are required. If these conditions are not met, Fisher's exact test can be used.
The null hypothesis states that the difference between the two population proportions is zero. Alternative hypotheses involve the difference being unequal to, greater than, or smaller than zero. The test statistic (Z) is calculated using the formula (estimate - expected value) / standard error, where the pooled proportion P hat is used to estimate the common proportion under the null hypothesis.
An example demonstrates comparing the proportion of cats with urinary problems on a raw meat diet versus canned food. With proportions of 0.10 and 0.18 respectively, and a calculated Z-value of -2.04, the p-value is 0.02. This is less than the significance level of 0.05, leading to the rejection of the null hypothesis, suggesting a lower proportion of urinary problems in cats eating raw meat.
The confidence interval for the difference in proportions is calculated as the difference in sample proportions ± Z times the standard error. Unlike the test statistic, the confidence interval does not use the pooled proportion. For the cat diet example, the 95% confidence interval ranges from -0.161 to -0.04, indicating a significant two-sided test as zero is outside this interval.
Another method to compare proportions is by expressing them as a ratio, known as relative risk, especially useful for very small proportions where the absolute difference is less informative. An example of heart attack rates in exercising vs. non-exercising groups shows that the non-exercising group is 1.25 times more likely to have a heart attack. Relative risk is commonly used in medical and epidemiological research.