Ch. 22 Resources

Chapter 22: Comparing Two Proportions

We now look at an example with two populations, from which we draw two samples and use them to create a confidence interval for the difference between two population proportions and test a hypothesis about a relationship between the two population proportions.

More Exit Polls

As we saw in the Chapter 20 Resources, exit polling from the 2004 general election found that among 2,178 voters in Washington state, 55% were female. Exit polls in California found that among 2,390 California voters, 51% were female. Is this difference significant? In other words, is there evidence that a greater percentage of Washington voters are female than California voters?

We can try to answer this question in two ways: with a confidence interval or with a hypothesis test. Let's try a confidence interval first.

Confidence Interval

A confidence level of 95% seems reasonable; as we did with a confidence interval for one proportion, we need to check conditions. Let's start with the Washington sample:

Randomization Condition: While we don't know how the Washington voters are selected, it is reasonable to assume that a professional polling organization would have used some sort of random selection process and that the voters are independent of one another.

10% Condition: The 2,178 voters certainly account for less than 10% of all Washington voters.

Success/Failure Condition: `n_W hat p_W = 2178(0.55) approx 1198 ge 10` and `n_W hat q_W = 2178(0.45) approx 980 ge 10`, so this condition is satisfied.

Now we must check the same conditions for the California voters:

Randomization Condition: It is reasonable to assume that a professional polling organization would have used some sort of random selection process and that the voters are independent of one another.

10% Condition: The 2,390 voters certainly account for less than 10% of all California voters.

Success/Failure Condition: `n_C hat p_C = 2390(0.51) approx 1219 ge 10` and `n_C hat q_C = 2390(0.49) approx 1171 ge 10`.

Finally, we must check that the voters in each sample group are independent of one another:

Independent Groups Assumption: We have no plausible reason to expect that the Washington and California voters are in any way related, so this assumption seems reasonable.

We wish to estimate the difference between the proportion of voters who are female in each state: `p_W - p_C`. We know the difference between the sample proportions:

`hat p_W - hatp_C = 0.55 - 0.51 = 0.04`

We know that the variance of the differences of the sample proportions, `Var(hat p_W - hat p_C)`, is the sum of the variances of the sample proportions:

`Var(hat p_W - hat p_C) = Var(hat p_W) + Var(hat p_C) = (p_W q_W)/(n_W) + (p_C q_C)/(n_C)`

so:

`SD(hat p_W - hat p_C) = sqrt((p_W q_W)/(n_W)+(p_C q_C)/(n_C))`

The only problem is that we don't know `p_W` or `p_C`. So we estimate the standard deviation by:

`SE(hat p_W - hat p_C) = sqrt((hat p_W hat q_W)/(n_W) + (hat p_C hat q_C)/(n_C))`

In our present example:

`SE(hat p_W - hat p_C) = sqrt(((0.55)(0.45))/(2178) + ((0.51)(0.49))/(2390)) approx 0.0148`

For a 95% confidence level, z* = 1.96, so ME = (1.96)(0.0148) ≈ 0.029. Since `hat p_W - p_C = \0.04`, our confidence interval is given by:

`0.011 < p_W - p_C < 0.069`

What does this tell us? We are 95% confident that the proportion of Washington voters who are female is somewhere between 1% and 7% greater than the proportion of California voters who are female. We can also conclude that, because 0% is not in this confidence interval, it appears that `p_W - p_C ne 0`, which is the same as `p_W ne p_C`.

The computations here are not that complicated, but as the formulas become more complex, they do become more time-consuming. For this reason, it will be acceptable on HW and exams to use the calculator to compute the confidence interval limits for a two-proportion confidence interval and to compute P-values for a two-proportion hypothesis test. (Unless otherwise specified, you should continue to show your work for one-proportion confidence intervals and hypothesis tests, however.) Do keep in mind that the calculator cannot check conditions, nor can it properly interpret the meaning of a confidence interval.

To find the confidence interval using the TI-84, press STAT, move the cursor right to TESTS, then down to 2-PropZInt... and press ENTER. For x1 use 1198, for n1 use 2178, for x2 use 1219, for n2 use 2390, for C-Level use 0.95:

2-PropZInt input for TI-84

Now move the cursor to Calculate and press ENTER. Check that you get the same results we did above when working "by hand":

output of 2-PropZInt on the TI-84

Hypothesis Tests

Now let's see what a hypothesis test will tell us. We'll use a significance level of α = 0.05. We wish to test the claim that the proportion of females among Washington voters is different from the proportion of females among California voters (in other words, `p_W ne p_C`):

H0: `p_W = p_C`

HA: `p_W ne p_C`

The conditions that we need to check are the same as for the confidence interval. Ordinarily for a hypothesis test, we would use the value of `p` in the null hypothesis for the success/failure condition, but in this case there is no hypothesized value. (We are supposing that `p_W = p_C`, but we aren't making any claim about what each of these proportions might be.) So as before we check:

`n_W hat p_W = 2178(0.55) approx 1198 ge 10`
`n_W hat q_W = 2178(0.45) approx 980 ge 10`
`n_C hat p_C = 2390(0.51) approx 1219 ge 10`
`n_C hat q_C = 2390(0.49) approx 1171 ge 10`

There is one difference from the confidence interval, however: since our null hypothesis states that `p_W = p_C`, we are operating under the assumption that the Washington and California proportions are the same. If these populations are in fact the same, then we can pool them together: out of a total of 2178 + 2390 = 4568 voters, 1198 + 1219 = 2417 are female, so:

`hat p_{po ol} = (2417)/(4568) approx 0.529`

which means that 52.9% of the combined sample are females. Thus our best estimate of the `SD(hat p_W - hat p_C)` is:

`SE(hat p_W - hat p_C) = sqrt((hat p_{po ol} hat q_{po ol})/(n_W) + (hat p_{po ol} hat q_{po ol})/(n_C)) = sqrt(((0.529)(0.471))/(2178) + ((0.529)(0.471))/(2390)) approx 0.0148`

In this example, pooling didn't really change the standard error, but in many cases it does. We can now use a Normal model for the differences in the sample proportions with mean 0 (since our hypothesis is that `p_W = p_C`) and standard deviation 0.0148: N(0,0.0148).

What is the probability that we get a two sample proportions with a difference of at least 0.04? In other words, if `p_W = p_C`, what is the probability that

`hat p_W - hat p_C > 0.04`

or that

`hat p_W - hat p_C < -0.04`

The first probability is given by normalcdf(0.04,1E99,0,0.0148) ≈ 0.003 and the second probability is also about 0.003, so the P-value is 0.006 < 0.05 = α. Thus we reject H0. We conclude that:

There is evidence (P = 0.006) to support the claim that the proportion of Washington voters who are female is different from the proportion of California voters who are female.

We could also have used a one-sided hypothesis test to test the claim that `p_W > p_C`.

The TI-84 offers a shortcut to find the P-value: press STAT, move the cursor right to TESTS, then down to 2-PropZTest and press ENTER. For x1 use 1198, for n1 use 2178, for x2 use 1219, for n2 use 2390, and for p1: use ≠p2 (the form of inequality in the alternative hypothesis):

input for 2-PropZTest on the TI-84

Now move the cursor to Calculate or Draw and press ENTER. You should see the P-value displayed, in addition to some other information:

output from 2-PropZTest on the TI-84 Normal model from the TI-84

Homework

Work the following problems in Chapter 22: 1, 3, 7, 11, 15, 17, 27, 31 and 39.

Errata

On page 564, the What in the margin note is incorrect: the (categorical) variables recorded about each of the adults is whether or not the person snores and the person's age; the "proportion who snore" is a summary statistic, not a variable.

On page 568, the left column of the Show should read SD(`hat p_{text: old} - hat p_{text: young}`) rather than SD(`p_{text: old} - p_{text:young}`).

Part c of Exercises 5 and 6 should read "What's the standard deviation" (not "standard error").

Part c of Exercises 9 and 10 should ask for an interpretation of the interval, rather than a conclusion.

The penultimate line of Exercise 14 should read "bar chart" (not "bar graph").

In Exercise 26, the sample size should be n = 250.

ActivStats

Work through the lessons on page 22-1 in the ActivStats lesson book, as time permits.

Additional Resources

Study Finds Surgery Works Best For Carpal Tunnel Syndrome
New York Times article about study mentioned in Exercise 10.