Hypothesis Test: Difference Between Proportions
This lesson explains how to conduct a hypothesis test to determine whether proportions from two independent groups are different. Here's a step-by-step guide to performing a two-proportion z-test, which is a common method for this type of hypothesis test.
When to Use This Analysis
The approach described in this lesson is appropriate when the following conditions are met:
- The sampling method for each population is simple random sampling.
- The samples are independent.
- Each sample includes at least 10 successes and 10 failures. (This condition is required to support an assumption that the sampling distribution of the proportion will be approximately normal in shape, which is necessary to justify the use of a two-proportion z-test.)
- Each population is at least 20 times as big as its sample. (This condition is required to justify using an approximate formula to compute the standard error of the sampling distribution.)
Before proceeding with a hypothesis test, ensure that these conditions are met.
General Procedure for Hypothesis Testing
To test any hypothesis, the same five-step procedure is used: (1) state the hypotheses, (2) choose the significance level, (3) compute the test statistic, (4) find the P-value, and (5) interpret results. Here, we apply the general procedure for hypothesis testing to the difference between two proportions.
State the Hypotheses
Every hypothesis test requires the analyst to state a null hypothesis and an alternative hypothesis . The hypotheses are stated in such a way that they are mutually exclusive. That is, if one is true, the other must be false, as shown below.
-
Null hypothesis (H0): Population proportions are equal .
H0: P1 = P2
-
Alternative hypothesis (Ha): The proportions differ in one of three possible ways.
Ha: P1 ≠ P2 (Two-tailed test checking for difference)
Ha: P1 > P2 (One-tailed test checking if P1 is bigger than P2
Ha: P1 < P2 (One-tailed test checking if P1 is smaller than P2
where P1 and P1 are independent population proportions./p>
Choose the Significance Level
Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but any value between 0 and 1 can be used.
Compute the Test Statistic
Use the two-proportion z-test to determine whether the hypothesized the independent population proportions differ significantly from one another. To find the test statistic (a z-score) for a two-proportion z-test, complete the following computations.
-
Pooled sample proportion. Since the null hypothesis states
that P1=P2, we use a pooled sample
proportion (p) to compute the
standard error
of the sampling distribution. The pooled sample proportion can be computed by either of these
equivalent formulas:
p = (p1 * n1 + p2 * n2) / (n1 + n2)
p = (x1 + x2) / (n1 + n2)
where p1 is the sample proportion from population 1, p2 is the sample proportion from population 2, x1 is the number of successes in sample 1, x2 is the number of successes in sample 2, n1 is the size of sample 1, and n2 is the size of sample 2. -
Standard error. Compute the standard error (SE)
of the sampling distribution difference between two proportions.
SE = sqrt{ p * ( 1 - p ) * [ (1/n1) + (1/n2) ] }
where p is the pooled sample proportion, n1 is the size of sample 1, and n2 is the size of sample 2. -
Test statistic. The test statistic is a z-score (z) defined by
the following equation.
z = (p1 - p2) / SE
where p1 is the proportion from sample 1, p2 is the proportion from sample 2, and SE is the standard error of the sampling distribution.
Find the P-Value
The P-value is the probability of observing a sample statistic as extreme as the z-score test statistic. To assess the probability associated with the z-score, use an online calculator, a graphing calculator, or a normal distribution statistical table. (See sample problems at the end of this lesson for examples of how this is done with Stat Trek's Normal Distribution Calculator.)
Interpret Results
If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis. This involves comparing the P-value to the significance level , and rejecting the null hypothesis when the P-value is less than the significance level.
Test Your Understanding
In this section, two sample problems illustrate how to conduct a hypothesis test for the difference between two proportions. The first problem involves a two-tailed test; the second problem, a one-tailed test.
Problem 1: Two-Tailed Test
Suppose the Acme Drug Company develops a new drug, designed to prevent colds. The company states that the drug is equally effective for men and women. To test this claim, they choose a a simple random sample of 100 women and 200 men from a population of 100,000 volunteers.
At the end of the study, 38% of the women caught a cold; and 51% of the men caught a cold. Based on these findings, can we reject the company's claim that the drug is equally effective for men and women? Use a 0.05 level of significance.
Solution: The solution to this problem takes five steps: (1) state the hypotheses, (2) choose the significance level, (3) compute the test statistic, (4) find the P-value, and (5) interpret results. We work through those steps below:
- State the hypotheses. The first step is to
state the null hypothesis and an alternative hypothesis.
Null hypothesis: P1 = P2
Alternative hypothesis: P1 ≠ P2
Note that these hypotheses constitute a two-tailed test. The null hypothesis will be rejected if the proportion from population 1 is too big or if it is too small. - Choose the significance level. For this analysis, the significance level is 0.05.
-
Compute the test statistic. The test method is a
two-proportion z-test. Using sample data, we
calculate the pooled sample proportion (p) and the standard error
(SE). With these measures, we compute the z-score
test statistic (z) required for a two-proportion z-test.
p = (p1 * n1 + p2 * n2) / (n1 + n2)
p = [(0.38 * 100) + (0.51 * 200)] / (100 + 200)
p = 140/300 = 0.467
SE = sqrt{ p * ( 1 - p ) * [ (1/n1) + (1/n2) ] }
SE = sqrt [ 0.467 * 0.533 * ( 1/100 + 1/200 ) ]
SE = sqrt [0.003733] = 0.061
z = (p1 - p2) / SE = (0.38 - 0.51)/0.061 = -2.13
where p1 is the sample proportion in sample 1, where p2 is the sample proportion in sample 2, n1 is the size of sample 1, and n2 is the size of sample 2.
- Compute the P-Value. Since we have a two-tailed test, the P-value is the probability that the z-score is less than -2.13 or greater than 2.13. We use the Normal Distribution Calculator to find P(z < -2.13) = 0.017. Since the standard normal distribution is symmetric with a mean of zero, we know that P(z > 2.13) = 0.017. Thus, the P-value = 0.017 + 0.017 = 0.034.

- Interpret results. Since the P-value (0.034) is less than the significance level (0.05), we cannot accept the null hypothesis.
Note: If you use this approach on an exam, you may also want to mention why this approach is appropriate. Specifically, the approach is appropriate because the sampling method was simple random sampling, the samples were independent, each population was at least 10 times larger than its sample, and each sample included at least 10 successes and 10 failures.
Problem 2: One-Tailed Test
Suppose the previous example is stated a little bit differently. Suppose the Acme Drug Company develops a new drug, designed to prevent colds. The company states that the drug is more effective for women than for men. To test this claim, they choose a a simple random sample of 100 women and 200 men from a population of 100,000 volunteers.
At the end of the study, 38% of the women caught a cold; and 51% of the men caught a cold. Based on these findings, can we conclude that the drug is more effective for women than for men? Use a 0.01 level of significance.
Solution: The solution to this problem takes five steps: (1) state the hypotheses, (2) choose the significance level, (3)compute the test statistic, (4) find the P-value, and (5) interpret results. We work through those steps below:
- State the hypotheses. The first step is to
state the null hypothesis and an alternative hypothesis.
Null hypothesis: P1 = P2
Alternative hypothesis: P1 < P2
Note that these hypotheses constitute a one-tailed test. The null hypothesis will be rejected if the proportion of women catching cold (p1) is sufficiently smaller than the proportion of men catching cold (p2). - Choose a significance level. For this analysis, the significance level is 0.01.
-
Compute the test statistic. The test method is a
two-proportion z-test. Using sample data, we
calculate the pooled sample proportion (p) and the standard error
(SE). Using those measures, we compute the z-score
test statistic (z) required for a two-proportion z-test.
p = (p1 * n1 + p2 * n2) / (n1 + n2)
p = [(0.38 * 100) + (0.51 * 200)] / (100 + 200)
p = 140/300 = 0.467
SE = sqrt{ p * ( 1 - p ) * [ (1/n1) + (1/n2) ] }
SE = sqrt [ 0.467 * 0.533 * ( 1/100 + 1/200 ) ]
SE = sqrt [0.003733] = 0.061
z = (p1 - p2) / SE = (0.38 - 0.51)/0.061 = -2.13
where p1 is the sample proportion in sample 1, where p2 is the sample proportion in sample 2, n1 is the size of sample 1, and n2 is the size of sample 2.
- Find the P-value. Since we have a one-tailed test, the P-value is the probability that the z-score is less than -2.13. The Normal Distribution Calculator tells us that P(z ≤ -2.13) is about 0.017. Thus, the P-value = 0.017.

- Interpret results. Since the P-value (0.017) is greater than the significance level (0.01), we cannot reject the null hypothesis.