Chapter 22 Powerpoint - Peacock

advertisement
Chapter 22
COMPARING TWO
PROPORTIONS
Objectives




Sampling distribution of the
difference between two proportions
2-proportion z-interval
Pooling
2-proportion z-test
Comparing Two Proportions


Comparisons between two
percentages are much more common
than questions about isolated
percentages. And they are more
interesting.
We often want to know how two
groups differ, whether a treatment is
better than a placebo control, or
whether this year’s results are better
than last year’s.
Another Ruler


In order to examine the difference
between two proportions, we need
another ruler—the standard deviation
of the sampling distribution model for
the difference between two
proportions.
Recall that standard deviations don’t
add, but variances do. In fact, the
variance of the sum or difference of
two independent random quantities is
the sum of their individual variances.
The Standard Deviation of the Difference
Between Two Proportions


Proportions observed in independent
random samples are independent. Thus,
we can add their variances. So…
The standard deviation of the difference
between two sample proportions is
SD  pˆ1  pˆ 2  

p1q1 p2 q2

n1
n2
Thus, the standard error is
SE  pˆ1  pˆ 2  
pˆ1qˆ1 pˆ 2 qˆ2

n1
n2
Assumptions and Conditions

Independence Assumptions:



Randomization Condition: The data in each
group should be drawn independently and at
random from a homogeneous population or
generated by a randomized comparative
experiment.
The 10% Condition: If the data are sampled
without replacement, the sample should not
exceed 10% of the population.
Independent Groups Assumption: The two
groups we’re comparing must be
independent of each other.
Assumptions and Conditions

Sample Size Condition:


Each of the groups must be big
enough…
Success/Failure Condition: Both groups
are big enough that at least 10
successes and at least 10 failures have
been observed in each.
The Sampling Distribution


We already know that for large
enough samples, each of our
proportions has an approximately
Normal sampling distribution.
The same is true of their difference.
The Sampling Distribution

Provided that the sampled values are
independent, the samples are
independent, and the samples sizes are
large enough, the sampling distribution of
pˆ1  pˆ 2 is modeled by a Normal model with


Mean:
  p1  p2
Standard deviation: SD  pˆ1  pˆ 2  
p1q1 p2 q2

n1
n2
The Sampling Distribution
The approximately normal sampling distribution
for ( p̂ 1 – p̂2):
Two-Proportion z-Interval


When the conditions are met, we are ready to find
the confidence interval for the difference of two
proportions:
The confidence interval is

ˆ
ˆ
 p1  p2   z  SE  pˆ1  pˆ 2 
where
SE  pˆ1  pˆ 2  

pˆ1qˆ1 pˆ 2 qˆ2

n1
n2
The critical value z* depends on the particular
confidence level, C, that you specify.
Example: 2-Proportion z-Interval

A recent study of 1000 randomly
chosen residents in each of two
randomly selected states indicated
that the percent of people living in
those states who were born in
foreign countries was 6.5% for State
A and 1.7% for State B. Find a 99%
confidence interval for the difference
between the proportions of foreignborn residents for these two states.
Procedure: 2-Proportion z-Interval
1)
Check Conditions
1)
2)
3)
4)
2)
Independence
Randomization
10% condition
Success/Failure
Calculation Confidence Interval
 pˆ1  pˆ 2   z  SE  pˆ1  pˆ 2 
3)
Conclusion
o
In context
SE  pˆ1  pˆ 2  
pˆ1qˆ1 pˆ 2 qˆ2

n1
n2
Solution
1)
Check Conditions
1)
2)
3)
4)
Independence: Groups from different randomly
selected states should be independent.
Randomization: Each sample was drawn
randomly from its respective state.
10% condition: Reasonable that the population
of both states is greater than 10,000.
Success/Failure:
nA pˆ A  1000(.065)  65  10
nB pˆ B  1000(.017)  17  10
nAqˆ A  1000(.935)  935  10
nB qˆ B  1000(.983)  983  10
Solution
2)
Calculate 99% Confidence Interval
 pˆ1  pˆ 2   z  SE  pˆ1  pˆ 2 
pˆ A  .065, pˆ B  .017 and pˆ A  pˆ B  (.065  .017)  .048
z *  2.576
SE  pˆ1  pˆ 2  
pˆ1qˆ1 pˆ 2 qˆ2
(.065)(.935) (.017)(.983)



 .0088
n1
n2
1000
1000
me  2.576(.0088)  .0227
99% CI: .048  .0227 or (.0253,.0707)
Solution

Conclusion

I am 99% confident that the percent
difference of foreign-born residents for
states A and B is between 2.5% and
7.1%.
Your Turn

Suppose the AGA would like to compare the
proportion of homes heated by gas in the
South with the corresponding proportion in
the North. AGA selected a random sample
of 60 homes located in the South and found
that 34 of the homes use gas for heating
fuel. AGA also randomly sampled 80 homes
in the North and found 42 used gas for
heating. Construct a 90% confidence
interval for the difference between the
proportions of Southern homes and
Northern homes which are heated by gas.
Solution
1)
Check Conditions
1)
2)
3)
4)
Independence: Samples from different parts of
the country (north and south) should be
independent.
Randomization: Each sample was drawn
randomly.
10% condition: Reasonable that the population
in the North is greater than 800 and the
population in the South is greater than 600.
Success/Failure:
42
North : pˆ N 
 .525
80
34
South : pˆ S 
 .567
60
nN pˆ N  80(.525)  42  10
nS pˆ S  60(.567)  34  10
nN qˆ N  80(.475)  38  10
nS qˆS  60(.433)  26  10
Solution
2)
Calculate 99% Confidence Interval
 pˆ1  pˆ 2   z  SE  pˆ1  pˆ 2 
pˆ S  .567, pˆ N  .525 and pˆ S  pˆ N  (.567  .525)  .042
z *  1.645
SE  pˆ1  pˆ 2  
pˆ1qˆ1 pˆ 2 qˆ2
(.567)(.433) (.525)(.475)



 .0849
n1
n2
60
80
me  1.645(.0849)  .140
90% CI: .042  .14 or (.098,.182)
Solution

Conclusion


I am 90% confident that the percent difference of
homes in the South and the North is between 9.8% and 18.2%.
Because the 90% confidence interval contains the
value 0, our samples have not indicated a real
difference between the proportions of Southern
homes and Northern homes which are heated by
gas. The proportion of Southern homes could be
smaller than the corresponding proportion for
Northern homes by as much as 9.8%, or the
proportion of Southern homes could exceed the
proportion for Northern homes by as much as
18.2%.
TI-84: 2-Proportion z-Interval


Press STAT key, choose TESTS, and
then choose B: 2-PropZInterval…
Adjust the settings;






x1: the number selected sample 1
n1: sample 1 sample size
x2: the number selected sample 2
n2: sample 2 sample size
C-level: confidence level
Select “Calculate”
Example – Using the TI-84

How much does the cholesterol-lowering drug
Gemfibrozil help reduce the risk of heart attack? We
compare the incidence of heart attack over a 5-year
period for two random samples of middle-aged men
taking either a placebo or the drug. Find a 90%
Confidence Interval for the decease in the
percentage of middle-aged men having heart
attacks on the cholesterol-lowering drug.
H. attack
n
Drug
56
2051
2.73%
Placebo
84
2030
4.14%
Solution

90% Confidence Interval


(.0047, .02345)
Conclusion

We are 90% confident that the percent
difference of middle-aged men who
suffer a heart attack is 0.47% to 2.3%
lower when taking the cholesterollowering drug.
TWO PROPORTION Z-TEST
Everyone into the Pool



The typical hypothesis test for the
difference in two proportions is the one of
no difference. In symbols, H0: p1 – p2 = 0.
Since we are hypothesizing that there is no
difference between the two proportions,
that means that the standard deviations for
each proportion are the same.
Since this is the case, we combine (pool)
the counts to get one overall proportion.
Everyone into the Pool

The pooled proportion is
pˆ pooled
Success1  Success2

n1  n2
where Success1  n1 pˆ1 and Success2  n2 pˆ 2

If the numbers of successes are not whole
numbers, round them first. (This is the only
time you should round values in the middle
of a calculation.)
Everyone into the Pool

We then put this pooled value into the
formula, substituting it for both sample
proportions in the standard error
formula:
SE pooled  pˆ1  pˆ 2  
pˆ pooled qˆ pooled
n1

pˆ pooled qˆ pooled
n2
Compared to What?


We’ll reject our null hypothesis if we see a
large enough difference in the two
proportions.
How can we decide whether the difference
we see is large?


Just compare it with its standard deviation.
Unlike previous hypothesis testing
situations, the null hypothesis doesn’t
provide a standard deviation, so we’ll use a
standard error (here, pooled).
Two-Proportion z-Test




The conditions for the two-proportion z-test are
the same as for the two-proportion z-interval.
We are testing the hypothesis H0: p1 – p2 = 0, or,
equivalently, H0: p1 = p2.
The alternative hypothesis is either; Ha: p1≠p2,
Ha: p1<p2, or Ha: p1>p2.
Because we hypothesize that the proportions are
equal, we pool them to find
pˆ pooled
Success1  Success2

n1  n2
Two-Proportion z-Test

We use the pooled value to estimate the standard error:
SE pooled  pˆ1  pˆ 2  

pˆ pooled qˆ pooled
n1

pˆ pooled qˆ pooled
n2
Now we find the test statistic:
( pˆ1  pˆ 2 )  0
z
SE pooled ( pˆ1  pˆ 2 )

When the conditions are met and the null hypothesis is true,
this statistic follows the standard Normal model, so we can
use that model to obtain a P-value.
Procedure: 2-Proportion z-Test
1.
2.
3.
Check conditions
Hypothesis
Test Statistic

pˆ pooled 
4.
5.
Z test statistic
Success1  Success2
n1  n2
P-value
Conclusion
( pˆ1  pˆ 2 )  0
z
SE pooled ( pˆ1  pˆ 2 )
SE pooled  pˆ1  pˆ 2  
pˆ pooled qˆ pooled
n1

pˆ pooled qˆ pooled
n2
Example: 2-Proportion z-Test

A researcher wants to know whether
there is a difference in AP-Statistics
exam failure rates between rural and
suburban students. She randomly
selects 107 rural students and 143
suburban students who took the
exam. Thirty rural students failed to
pass their exam, while 45 suburban
students failed the exam. Is there a
significant difference in failure rates
for these groups?
Solution
1)
Check Conditions
1.
2.
3.
4.
Independence: Rural and Suburban student
groups are independent.
Randomization: Samples were randomly drawn.
10% Condition: It is reasonable to believe that
the population of rural exam takers is greater
than 1070 and the population of suburban exam
takers is greater than 1430.
Success/Failures:
success1=30>10
success2=45>10
failure1=(107-30)=77>10
failure2=(143-45)=98>10
Solution
2)
Hypothesis


Null hypothesis – H0: pR=pS (There is
no difference in failure rates.)
Alternative hypothesis – Ha: pR≠pS
(There is a difference in failure rates.)
Solution
Test Statistic
3)
pˆ R 
30
45
 .280, pˆ S 
 .315, and pˆ R  pˆ S  .280  .315  .035
107
143
pˆ pooled 
Success1  Success2
30  45

 .3
n1  n2
107  143
SE pooled  pˆ1  pˆ 2  
pˆ pooled qˆ pooled
n1

pˆ pooled qˆ pooled
n2
1 
 1
 (.3)(.7) 

  .059
107
143


( pˆ1  pˆ 2 )  0
.035  0
z

 .59
SE pooled ( pˆ1  pˆ 2 )
.059
Solution
4)
P-value



5)
z = -.59 and a two-tailed test
P-value = 2P(z > .59) = 2(.2776)
P-value = .5552
Conclusion
The P-value .5552 is too high, thus we
fail to reject the null hypothesis. There
is insufficient evidence to show a
difference between the failure rates of
rural and suburban students on the AP
Statistics exam.
Your Turn: 2-Proportion z-Test


In recent years there has been a trend toward both parents
working outside the home. Do working mothers experience the
same burdens and family pressures as their spouses? A popular
belief is that the proportion of working mothers who feel they
have enough spare time for themselves is significantly less than
the corresponding proportion of working fathers. In order to test
this claim, independent random samples of 100 working mothers
and 100 working fathers were selected and their views on spare
time for themselves were recorded. A summary of the data is
given in the table below.
Is the belief that the proportion of working mothers who feel they
have enough spare time for themselves less than the
corresponding proportion of working fathers supported at
significance level α=.01 by the sample information?
Number sampled
Number who feel they have
enough spare time
Working Mothers
Working Fathers
100
100
37
56
Solution
1)
Check Conditions
1.
2.
3.
4.
Independence: Samples were independent.
Randomization: Samples were randomly drawn.
10% Condition: It is reasonable to believe that
the population of mothers and fathers is greater
than 1000.
Success/Failures:
success1=37>10
success2=56>10
failure1=(100-37)=63>10
failure2=(100-56)=44>10
Solution
2)
Hypothesis


Null hypothesis – H0: pM=pF (There is
no difference between Mothers and
Fathers who feel they have enough
spare time for themselves.)
Alternative hypothesis – Ha: pM<pF
(The proportion of working mothers
who feel they have enough spare time
for themselves is less than the
corresponding proportion of working
fathers .)
Solution
3)
Test Statistic
pˆ M 
37
56
 .37, pˆ F 
 .56, and pˆ M  pˆ F  .37  .56  .19
100
100
pˆ pooled 
Success1  Success2
37  56

 .465
n1  n2
100  100
SE pooled  pˆ1  pˆ 2  
pˆ pooled qˆ pooled
n1

pˆ pooled qˆ pooled
n2
1 
 1
 (.465)(.535) 

  .0705
100
100


( pˆ1  pˆ 2 )  0
.19  0
z

 2.70
SE pooled ( pˆ1  pˆ 2 )
.0705
Solution
4)
P-value



5)
z = -2.70 and a left-tailed test
P-value = P(z < -2.70) = .0035
P-value = .0035
Conclusion
The p-value = .0035 is less than α = .01, thus
we reject the null hypothesis. There is sufficient
evidence at the 1% significance level to
conclude that the proportion of working mothers
who feel they have enough spare time for
themselves is less than the corresponding
proportion of working fathers.
TI-84: 2-Proportion z-Test


Press STAT key, choose TESTS, and
then choose 6: 2-PropZTest…
Adjust the settings;






x1:
n1:
x2:
n2:
p1:
the number selected sample 1
sample 1 sample size
the number selected sample 2
sample 2 sample size
select type of test (≠p2, <p2, >p2)
Select “Calculate”
Example Using TI-84

To market a new white wine, a winemaker decides to use
two different advertising agencies, one operating in the
east, one in the west. After the white wine has been on
the market for 8 months, independent random samples of
wine drinkers are taken from each of the two regions and
questioned concerning their white wine preference. The
numbers favoring the new brand are shown in the table.
Is there evidence that the proportion of wine drinkers in
the west who prefer the new wine is greater than the
corresponding proportion of wine drinkers in the east. Test
at the .02 significance level.
Number sampled
Number who prefer the new white wine
East
West
516
438
18
23
Solution



H0:pW=pE
Ha:pW>pE
2-PropZTest







x1:
n1:
x2:
n2:
p1:
23
438
18
516
>p2
z = 1.338 and P-value = .0905
Conclusion

The P-value .0905 is greater than α =.02, thus we fail to
reject the null hypothesis. There is insufficient evidence at the
.02 significance level to conclude that the proportion of wine
drinkers in the west who prefer the new white wine is greater
than the corresponding proportion of wine drinkers in the
east.
What Can Go Wrong?

Don’t use two-sample proportion methods
when the samples aren’t independent.


Don’t apply inference methods when there
was no randomization.


These methods give wrong answers when the
independence assumption is violated.
Our data must come from representative random
samples or from a properly randomized
experiment.
Don’t interpret a significant
difference in proportions causally.

Be careful not to jump to conclusions
about causality.
What have we learned?


We’ve now looked at inference for
the difference in two proportions.
Perhaps the most important thing to
remember is that the concepts and
interpretations are essentially the
same—only the mechanics have
changed slightly.
What have we learned? (cont.)

Hypothesis tests and confidence intervals
for the difference in two proportions are
based on Normal models.

Both require us to find the standard error of the
difference in two proportions.
 We do that by adding the variances of the two
sample proportions, assuming our two groups
are independent.
 When we test a hypothesis that the two
proportions are equal, we pool the sample
data; for confidence intervals we don’t pool.
Assignment

Pg 519 – 522: #1 – 21 odd
Download