Suppose we wish to compare the proportions of two populations that have a specific characteristic, such as the proportion of men who are left-handed compared to the proportion of women who are left-handed. Figure 9.7 "Independent Sampling from Two Populations In Order to Compare Proportions" illustrates the conceptual framework of our investigation. Each population is divided into two groups, the group of elements that have the characteristic of interest (for example, being left-handed) and the group of elements that do not. We arbitrarily label one population as Population 1 and the other as Population 2, and subscript the proportion of each population that possesses the characteristic with the number 1 or 2 to tell them apart. We draw a random sample from Population 1 and label the sample statistic it yields with the subscript 1. Without reference to the first sample we draw a sample from Population 2 and label its sample statistic with the subscript 2.
Figure 9.7 Independent Sampling from Two Populations In Order to Compare Proportions
Our goal is to use the information in the samples to estimate the difference p1−p2 in the two population proportions and to make statistically valid inferences about it.
Since the sample proportion ˆp1 computed using the sample drawn from Population 1 is a good estimator of population proportion p1 of Population 1 and the sample proportion ˆp2 computed using the sample drawn from Population 2 is a good estimator of population proportion p2 of Population 2, a reasonable point estimate of the difference p1−p2 is ˆp1−ˆp2. In order to widen this point estimate into a confidence interval we suppose that both samples are large, as described in Section 7.3 "Large Sample Estimation of a Population Proportion" in Chapter 7 "Estimation" and repeated below. If so, then the following formula for a confidence interval for p1−p2 is valid.
The samples must be independent, and each sample must be large: each of the intervals
[ˆp1−3 √ˆp1(1−ˆp1)n1, ˆp1+3 √ˆp1(1−ˆp1)n1 ]and
[ˆp2−3 √ˆp2(1−ˆp2)n2, ˆp2+3 √ˆp2(1−ˆp2)n2 ]must lie wholly within the interval [0,1 ].
The department of code enforcement of a county government issues permits to general contractors to work on residential projects. For each permit issued, the department inspects the result of the project and gives a “pass” or “fail” rating. A failed project must be re-inspected until it receives a pass rating. The department had been frustrated by the high cost of re-inspection and decided to publish the inspection records of all contractors on the web. It was hoped that public access to the records would lower the re-inspection rate. A year after the web access was made public, two samples of records were randomly selected. One sample was selected from the pool of records before the web publication and one after. The proportion of projects that passed on the first inspection was noted for each sample. The results are summarized below. Construct a point estimate and a 90% confidence interval for the difference in the passing rate on first inspection between the two time periods.
No public web accessn1=500ˆp1=0.67Public web accessn2=100ˆp2=0.80Solution:
The point estimate of p1−p2 is
ˆp1−ˆp2=0.67−0.80=−0.13Because the “No public web access” population was labeled as Population 1 and the “Public web access” population was labeled as Population 2, in words this means that we estimate that the proportion of projects that passed on the first inspection increased by 13 percentage points after records were posted on the web.
The sample sizes are sufficiently large for constructing a confidence interval since for sample 1:
3 √ˆp1(1−ˆp1)n1=3 √(0.67)(0.33)500=0.06so that
[ˆp1−3 √ˆp1(1−ˆp1)n1, ˆp1+3 √ˆp1(1−ˆp1)n1]=[0.67−0.06,0.67+0.06 ]=[0.61,0.73 ]⊂[0,1 ]and for sample 2:
3 √ˆp1(1−ˆp1)n1=3 √(0.8)(0.2)100=0.12so that
[ˆp2−3 √ˆp2(1−ˆp2)n2, ˆp2+3 √ˆp2(1−ˆp2)n2]=[0.8−0.12,0.8+0.12 ]=[0.68,0.92 ]⊂[0,1 ]To apply the formula for the confidence interval, we first observe that the 90% confidence level means that α=1−0.90=0.10 so that zα∕2=z0.05. From Figure 12.3 "Critical Values of " we read directly that z0.05=1.645. Thus the desired confidence interval is
(ˆp1−ˆp2)±zα∕2√ˆp1(1−ˆp1)n1+ˆp2(1−ˆp2)n2=−0.13±1.645√(0.67)(0.33)500+(0.8)(0.2)100 =−0.13±0.07The 90% confidence interval is [−0.20,−0.06 ]. We are 90% confident that the difference in the population proportions lies in the interval [−0.20,−0.06 ], in the sense that in repeated sampling 90% of all intervals constructed from the sample data in this manner will contain p1−p2. Taking into account the labeling of the two populations, this means that we are 90% confident that the proportion of projects that pass on the first inspection is between 6 and 20 percentage points higher after public access to the records than before.
In hypothesis tests concerning the relative sizes of the proportions p1 and p2 of two populations that possess a particular characteristic, the null and alternative hypotheses will always be expressed in terms of the difference of the two population proportions. Hence the null hypothesis is always written
H0:p1−p2=D0The three forms of the alternative hypothesis, with the terminology for each case, are:
Form of Ha | Terminology |
---|---|
Ha:p1−p2<D0 | Left-tailed |
Ha:p1−p2>D0 | Right-tailed |
Ha:p1−p2≠D0 | Two-tailed |
As long as the samples are independent and both are large the following formula for the standardized test statistic is valid, and it has the standard normal distribution.
The test statistic has the standard normal distribution.
The samples must be independent, and each sample must be large: each of the intervals
[ˆp1−3 √ˆp1(1−ˆp1)n1, ˆp1+3 √ˆp1(1−ˆp1)n1 ]and
[ˆp2−3 √ˆp2(1−ˆp2)n2, ˆp2+3 √ˆp2(1−ˆp2)n2 ]must lie wholly within the interval [0,1 ].
Using the data of Note 9.25 "Example 10", test whether there is sufficient evidence to conclude that public web access to the inspection records has increased the proportion of projects that passed on the first inspection by more than 5 percentage points. Use the critical value approach at the 10% level of significance.
Solution:
Step 1. Taking into account the labeling of the populations an increase in passing rate at the first inspection by more than 5 percentage points after public access on the web may be expressed as p2>p1+0.05, which by algebra is the same as p1−p2<−0.05. This is the alternative hypothesis. Since the null hypothesis is always expressed as an equality, with the same number on the right as is in the alternative hypothesis, the test is
H0:p1−p2=−0.05 vs. Ha:p1−p2<−0.05@ α=0.10Step 2. Since the test is with respect to a difference in population proportions the test statistic is
Z=(ˆp1−ˆp2)−D0√ˆp1(1−ˆp1)n1+ˆp2(1−ˆp2)n2Step 3. Inserting the values given in Note 9.25 "Example 10" and the value D0=−0.05 into the formula for the test statistic gives
Z=(ˆp1−ˆp2)−D0√ˆp1(1−ˆp1)n1+ˆp2(1−ˆp2)n2=(−0.13)−(−0.05)√(0.67)(0.33)500+(0.8)(0.2)100=−1.770Step 5. As shown in Figure 9.8 "Rejection Region and Test Statistic for " the test statistic falls in the rejection region. The decision is to reject H0. In the context of the problem our conclusion is:
The data provide sufficient evidence, at the 10% level of significance, to conclude that the rate of passing on the first inspection has increased by more than 5 percentage points since records were publicly posted on the web.
Figure 9.8 Rejection Region and Test Statistic for Note 9.27 "Example 11"
Perform the test of Note 9.27 "Example 11" using the p-value approach.
Solution:
The first three steps are identical to those in Note 9.27 "Example 11".
Finally a common misuse of the formulas given in this section must be mentioned. Suppose a large pre-election survey of potential voters is conducted. Each person surveyed is asked to express a preference between, say, Candidate A and Candidate B. (Perhaps “no preference” or “other” are also choices, but that is not important.) In such a survey, estimators ˆpA and ˆpB of pA and pB can be calculated. It is important to realize, however, that these two estimators were not calculated from two independent samples. While ˆpA−ˆpB may be a reasonable estimator of pA−pB, the formulas for confidence intervals and for the standardized test statistic given in this section are not valid for data obtained in this manner.
Construct the confidence interval for p1−p2 for the level of confidence and the data given. (The samples are sufficiently large.)
90% confidence,
n1=1670, ˆp1=0.42
n2=900, ˆp2=0.38
95% confidence,
n1=600, ˆp1=0.84
n2=420, ˆp2=0.67
Construct the confidence interval for p1−p2 for the level of confidence and the data given. (The samples are sufficiently large.)
98% confidence,
n1=750, ˆp1=0.64
n2=800, ˆp2=0.51
99.5% confidence,
n1=250, ˆp1=0.78
n2=250, ˆp2=0.51
Construct the confidence interval for p1−p2 for the level of confidence and the data given. (The samples are sufficiently large.)
80% confidence,
n1=300, ˆp1=0.255
n2=400, ˆp2=0.193
95% confidence,
n1=3500, ˆp1=0.147
n2=3750, ˆp2=0.131
Construct the confidence interval for p1−p2 for the level of confidence and the data given. (The samples are sufficiently large.)
99% confidence,
n1=2250, ˆp1=0.915
n2=2525, ˆp2=0.858
95% confidence,
n1=120, ˆp1=0.650
n2=200, ˆp2=0.505
Perform the test of hypotheses indicated, using the data given. Use the critical value approach. Compute the p-value of the test as well. (The samples are sufficiently large.)
Test H0:p1−p2=0 vs. Ha:p1−p2>0 @ α=0.10,
n1=1200, ˆp1=0.42
n2=1200, ˆp2=0.40
Test H0:p1−p2=0 vs. Ha:p1−p2≠0 @ α=0.05,
n1=550, ˆp1=0.61
n2=600, ˆp2=0.67
Perform the test of hypotheses indicated, using the data given. Use the critical value approach. Compute the p-value of the test as well. (The samples are sufficiently large.)
Test H0:p1−p2=0.05 vs. Ha:p1−p2>0.05 @ α=0.05,
n1=1100, ˆp1=0.57
n2=1100, ˆp2=0.48
Test H0:p1−p2=0 vs. Ha:p1−p2≠0 @ α=0.05,
n1=800, ˆp1=0.39
n2=900, ˆp2=0.43
Perform the test of hypotheses indicated, using the data given. Use the critical value approach. Compute the p-value of the test as well. (The samples are sufficiently large.)
Test H0:p1−p2=0.25 vs. Ha:p1−p2<0.25 @ α=0.005,
n1=1400, ˆp1=0.57
n2=1200, ˆp2=0.37
Test H0:p1−p2=0.16 vs. Ha:p1−p2≠0.16 @ α=0.02,
n1=750, ˆp1=0.43
n2=600, ˆp2=0.22
Perform the test of hypotheses indicated, using the data given. Use the critical value approach. Compute the p-value of the test as well. (The samples are sufficiently large.)
Test H0:p1−p2=0.08 vs. Ha:p1−p2>0.08 @ α=0.025,
n1=450, ˆp1=0.67
n2=200, ˆp2=0.52
Test H0:p1−p2=0.02 vs. Ha:p1−p2≠0.02 @ α=0.001,
n1=2700, ˆp1=0.837
n2=2900, ˆp2=0.854
Perform the test of hypotheses indicated, using the data given. Use the p-value approach. (The samples are sufficiently large.)
Test H0:p1−p2=0 vs. Ha:p1−p2<0 @ α=0.005,
n1=1100, ˆp1=0.22
n2=1300, ˆp2=0.27
Test H0:p1−p2=0 vs. Ha:p1−p2≠0 @ α=0.01,
n1=650, ˆp1=0.35
n2=650, ˆp2=0.41
Perform the test of hypotheses indicated, using the data given. Use the p-value approach. (The samples are sufficiently large.)
Test H0:p1−p2=0.15 vs. Ha:p1−p2>0.15 @ α=0.10,
n1=950, ˆp1=0.41
n2=500, ˆp2=0.23
Test H0:p1−p2=0.10 vs. Ha:p1−p2≠0.10 @ α=0.10,
n1=220, ˆp1=0.92
n2=160, ˆp2=0.78
Perform the test of hypotheses indicated, using the data given. Use the p-value approach. (The samples are sufficiently large.)
Test H0:p1−p2=0.22 vs. Ha:p1−p2>0.22 @ α=0.05,
n1=90, ˆp1=0.72
n2=75, ˆp2=0.40
Test H0:p1−p2=0.37 vs. Ha:p1−p2≠0.37 @ α=0.02,
n1=425, ˆp1=0.772
n2=425, ˆp2=0.331
Perform the test of hypotheses indicated, using the data given. Use the p-value approach. (The samples are sufficiently large.)
Test H0:p1−p2=0.50 vs. Ha:p1−p2<0.50 @ α=0.10,
n1=40, ˆp1=0.65
n2=55, ˆp2=0.24
Test H0:p1−p2=0.30 vs. Ha:p1−p2≠0.30 @ α=0.10,
n1=7500, ˆp1=0.664
n2=1000, ˆp2=0.319
In all the remaining exercsises the samples are sufficiently large (so this need not be checked).
Voters in a particular city who identify themselves with one or the other of two political parties were randomly selected and asked if they favor a proposal to allow citizens with proper license to carry a concealed handgun in city parks. The results are:
Party A | Party B | |
---|---|---|
Sample size, n | 150 | 200 |
Number in favor, x | 90 | 140 |
To investigate a possible relation between gender and handedness, a random sample of 320 adults was taken, with the following results:
Men | Women | |
---|---|---|
Sample size, n | 168 | 152 |
Number of left-handed, x | 24 | 9 |
A local school board member randomly sampled private and public high school teachers in his district to compare the proportions of National Board Certified (NBC) teachers in the faculty. The results were:
Private Schools | Public Schools | |
---|---|---|
Sample size, n | 80 | 520 |
Proportion of NBC teachers, ˆp | 0.175 | 0.150 |
In professional basketball games, the fans of the home team always try to distract free throw shooters on the visiting team. To investigate whether this tactic is actually effective, the free throw statistics of a professional basketball player with a high free throw percentage were examined. During the entire last season, this player had 656 free throws, 420 in home games and 236 in away games. The results are summarized below.
Home | Away | |
---|---|---|
Sample size, n | 420 | 236 |
Free throw percent, ˆp | 81.5% | 78.8% |
Randomly selected middle-aged people in both China and the United States were asked if they believed that adults have an obligation to financially support their aged parents. The results are summarized below.
China | USA | |
---|---|---|
Sample size, n | 1300 | 150 |
Number of yes, x | 1170 | 110 |
Test, at the 1% level of significance, whether the data provide sufficient evidence to conclude that there exists a cultural difference in attitude regarding this question.
A manufacturer of walk-behind push mowers receives refurbished small engines from two new suppliers, A and B. It is not uncommon that some of the refurbished engines need to be lightly serviced before they can be fitted into mowers. The mower manufacturer recently received 100 engines from each supplier. In the shipment from A, 13 needed further service. In the shipment from B, 10 needed further service. Test, at the 10% level of significance, whether the data provide sufficient evidence to conclude that there exists a difference in the proportions of engines from the two suppliers needing service.
Large Data Sets 6A and 6B record results of a random survey of 200 voters in each of two regions, in which they were asked to express whether they prefer Candidate A for a U.S. Senate seat or prefer some other candidate. Let the population of all voters in region 1 be denoted Population 1 and the population of all voters in region 2 be denoted Population 2. Let p1 be the proportion of voters in Population 1 who prefer Candidate A, and p2 the proportion in Population 2 who do.
https://www.gone.2012books.lardbucket.org/sites/all/files/data6A.xls
https://www.gone.2012books.lardbucket.org/sites/all/files/data6B.xls
Large Data Set 11 records the results of samples of real estate sales in a certain region in the year 2008 (lines 2 through 536) and in the year 2010 (lines 537 through 1106). Foreclosure sales are identified with a 1 in the second column. Let all real estate sales in the region in 2008 be Population 1 and all real estate sales in the region in 2010 be Population 2.
https://www.gone.2012books.lardbucket.org/sites/all/files/data11.xls
Z = 4.498, ±z0.005=±2.576, reject H0 (different)