Calculating the Test Statistic and P-Value for a Difference in Proportions
Once conditions are met, we calculate a standardized test statistic (z) for the difference in sample proportions.
The test statistic standardizes the observed difference using the combined (pooled) proportion, p̂_c.
The null hypothesis assumes no difference, so the observed difference is compared to 0.
The P-value is found using the standard normal distribution and depends on the direction of the alternative hypothesis.
Calculator results may differ slightly from hand calculations due to rounding, but conclusions should be the same.
Difference in Population Proportions
Hi everyone. In this video, we’re going to talk about how to calculate the standardized test statistic and the P-value for a significance test about a difference in population proportions.
If the conditions are met, we can proceed with the calculations to test the null and alternative hypotheses.
To perform the test, we need to standardize the difference in sample proportions to obtain a z statistic.
Assuming the conditions are met, the standardized test statistic is calculated as:
z = (p̂₁ − p̂₂ − 0) / standard error
We subtract 0 because under the null hypothesis, we are assuming there is no difference between the population proportions.
The standard error for this test uses the combined (pooled) sample proportion, p̂_c.
The combined proportion is calculated as:
p̂_c = (x₁ + x₂) / (n₁ + n₂)
where:
x₁ and x₂ are the number of successes in each sample
n₁ and n₂ are the sample sizes
The standard error is then calculated using:
standard error = √[ p̂_c (1 − p̂_c) (1/n₁ + 1/n₂) ]
This works because p̂_c represents the proportion of successes assuming the null hypothesis is true.
After calculating the z statistic, we find the P-value by calculating the probability of getting a z statistic as extreme or more extreme than the observed value, in the direction specified by the alternative hypothesis, using the standard normal distribution.
The specific formula for the standardized test statistic for a difference in population proportions is not explicitly given on the AP Statistics formula sheet.
However:
The general z-test structure is provided
The standard error formula is provided
You must know when to use each formula and how to put the pieces together.
Let’s return to the McDonald’s and Wendy’s drive-through example.
Before doing the full hypothesis test, we want to explain why the sample result gives some evidence for the alternative hypothesis.
The observed difference in sample proportions is:
p̂_M − p̂_W = 0.059
This value is not equal to 0, so it does provide some evidence in favor of the alternative hypothesis. However, this alone does not tell us whether the evidence is convincing, which is why we must perform the full hypothesis test.
First, we calculate the combined proportion:
p̂_c = (145 + 139) / (159 + 163) = 284 / 322 ≈ 0.882
Now we calculate the z statistic:
z = (0.059 − 0) / √[ 0.882 (1 − 0.882) (1/159 + 1/163) ] ≈ 1.64
To find the P-value, we can use either Table A or a calculator.
We use the normal CDF:
Lower bound: 1.64
Upper bound: a very large number
Mean: 0
Standard deviation: 1
Because this is a two-sided test, we multiply the result by 2.
From Table A, a z-score of 1.64 gives an area of 0.9495 to the left.
We subtract from 1 to find the upper-tail probability, then multiply by 2 to account for both tails.
In both methods, the P-value is approximately 0.18.
At a significance level of α = 0.05, the P-value of 0.18 is greater than α, so we fail to reject the null hypothesis.
There is not convincing evidence of a difference in the population proportions of accurate drive-through orders at McDonald’s and Wendy’s.
This result can also be visualized using the standard normal distribution. Because this is a two-sided test, the P-value represents the probability in both tails of the distribution.
Although the probability is relatively small, it is not small enough to rule out variation due to random sampling.
To perform this test on a calculator:
Go to STAT
Select TESTS
Choose 2-PropZTest
Enter:
x₁ = 145, n₁ = 159
x₂ = 139, n₂ = 163
Alternative: not equal
Select Calculate.
The calculator provides:
The z statistic
The P-value
p̂₁, p̂₂, and the combined proportion p̂_c
The calculator uses the symbol p̂ for the combined proportion.
Calculator values may differ slightly from hand calculations due to rounding.
The calculator can also display a graph of the standard normal distribution with the shaded P-value area.
Because this test often leads to calculation errors, it is recommended to use the calculator on the AP Statistics exam.
Even when using technology, you must still show all four steps: State, Plan, Do, and Conclude.
In the Do step, always report the z statistic and the P-value.
That’s it for this video. I hope this was helpful. Take care.
UP Next: