The two-sample proportion test is a statistical hypothesis test used to compare the proportions of a specific attribute (e.g., success, failure, presence, or absence of a characteristic) between two independent groups. This test is appropriate when the data are categorical (binary) and follow a binomial distribution.
For example, you might use a two-sample proportion test to determine whether the click-through rates (CTRs) of two different online ad campaigns are significantly different.
The null hypothesis (H0) for the two-sample proportion test states that there is no significant difference between the proportions of the two groups (P1 = P2). The alternative hypothesis (H1) states that there is a significant difference between the proportions (P1 ≠ P2).
To perform the two-sample proportion test, follow these steps:
- Calculate the pooled proportion: This is the overall proportion of successes in both groups combined. It is calculated as the total number of successes divided by the total number of trials in both groups.Pooled proportion = (X1 + X2) / (n1 + n2)
where X1 and X2 are the number of successes in groups 1 and 2, and n1 and n2 are the sample sizes of groups 1 and 2, respectively.
- Calculate the standard error: The standard error measures the variability of the difference between the two sample proportions.Standard error = sqrt[(Pooled proportion * (1 – Pooled proportion)) * (1/n1 + 1/n2)]
- Calculate the test statistic: The test statistic is a Z-score, which measures how many standard errors away the observed difference between the sample proportions is from the expected difference (under the null hypothesis).Z = (P1 – P2) / Standard error
- Determine the critical value and p-value: Compare the test statistic (Z-score) to a critical value from the standard normal distribution based on the desired significance level (usually 0.05). Calculate the p-value, which represents the probability of observing a test statistic as extreme as or more extreme than the one calculated if the null hypothesis were true.
- Make a decision: If the test statistic is greater than the critical value or the p-value is less than the significance level, reject the null hypothesis. This would suggest that there is a significant difference between the proportions of the two groups.
The two-sample proportion test is a statistical method used to compare the proportions of a specific attribute between two independent groups. It helps determine if there is a significant difference in the proportions based on the collected data.