chapter 20lzhang/teaching/1070spring2012... · chapter 20 2 case study a study is performed to test...
TRANSCRIPT
BPS - 5th Ed. Chapter 20 1
Chapter 20
Comparing Two Proportions
BPS - 5th Ed. Chapter 20 2
Case Study
A study is performed to test of the reliability of products produced by two machines. Machine A produced 8 defective parts in a run of 140, while machine B produced 10 defective parts in a run of 200.
n DefectsMachine A 140 8Machine B 200 11
Machine Reliability
BPS - 5th Ed. Chapter 20 3
Two-Sample ProblemsThe goal of inference is to compare the responses to two treatments or to compare the characteristics of two populations.We have a separate sample from each treatment or each population. The units are not matched, and the samples can be of differing sizes.
BPS - 5th Ed. Chapter 20 4
Case Study
A study is performed to test of the reliability of products produced by two machines. Machine A produced 8 defective parts in a run of 140, while machine B produced 10 defective parts in a run of 200.
This is an example of when to use the two-proportion z procedures.
n DefectsMachine A 140 8Machine B 200 11
Machine Reliability
BPS - 5th Ed. Chapter 20 5
Inference about the Difference p1 – p2 Simple Conditions
The difference in the population proportions is estimated by the difference in the sample proportions:
When both of the samples are large, the sampling distribution of this difference is approximately Normal with mean p1 – p2 and standard deviation
21 pp ˆˆ −
( ) ( )2
22
1
11 11n
ppn
pp −+
−
BPS - 5th Ed. Chapter 20 6
Inference about the Difference p1 – p2 Sampling Distribution
BPS - 5th Ed. Chapter 20 7
Since the population proportions p1 and p2 are unknown, the standard deviation of the difference in sample proportions will need to be estimated by substituting
for p1 and p2 :
Standard Error
21 and pp ˆˆ
( ) ( )2
22
1
11 11n
ppn
ppSEˆˆˆˆ −
+−
=
BPS - 5th Ed. Chapter 20 8
BPS - 5th Ed. Chapter 20 9
Case Study: Reliability
We are 90% confident that the difference in proportion of defectives for the two machines is between -3.97% and 4.39%. Since 0 is in this interval, it is unlikely that the two machines differ in reliability.
( ) ( ) ( )2
22
1
1121
11n
ppn
ppzppˆˆˆˆˆˆ −
+−
±− ∗
Compute a 90% confidence interval for the difference in reliabilities (as measured by proportion of defectives) for the two machines.
Confidence Interval
0.0439 to 0.03970.04180.0021
200200111
20011
140140
81140
8
1.64520011
1408
−=±=
⎟⎠⎞⎜
⎝⎛ −
+⎟⎠⎞⎜
⎝⎛ −
±⎟⎠⎞
⎜⎝⎛ −=
BPS - 5th Ed. Chapter 20 10
The standard confidence interval approach yields unstable or erratic inferences.
By adding four imaginary observations (one success and one failure to each sample), the inferences can be stabilized.
This leads to more accurate inference of the difference of the population proportions.
Adjustment to Confidence Interval “Plus Four” Confidence Interval for p1 – p2
BPS - 5th Ed. Chapter 20 11
Adjustment to Confidence Interval “Plus Four” Confidence Interval for p1 – p2
Add 4 imaginary observations, one success and one failure to each sample.Compute the “plus four” proportions.
Use the “plus four” proportions in the formula.
21successes of number
11 +
+=n
p~2
1successes of number2
2 ++=
np~
( ) ( ) ( )2
12
12
22
1
1121 +
−+
+−
±− ∗
np~p~
np~p~zp~p~
BPS - 5th Ed. Chapter 20 12
Case Study: Reliability“Plus Four” 90% Confidence Interval
1429
214018
1 =++=p~
20212
2200111
2 =++=p~
( ) ( ) ( )2
12
12
22
1
1121 +
−+
+−
±− ∗
np~p~
np~p~zp~p~
04740 to 039400434000400
202202121
20212
142142
91142
9
645120212
1429
....
.
−=±=
⎟⎠⎞⎜
⎝⎛ −
+⎟⎠⎞⎜
⎝⎛ −
±⎟⎠⎞
⎜⎝⎛ −=
We are 90% confident that the difference in proportion of defectives for the two machines is between -3.94% and 4.74%. Since 0 is in this interval, it is unlikely that the two machines differ in reliability.
(This is more accurate.)
BPS - 5th Ed. Chapter 20 13
The Hypotheses for Testing Two ProportionsNull: H0: p1 = p2
One sided alternativesHa : p1 > p2
Ha : p1 < p2
Two sided alternativeHa : p1 ≠
p2
BPS - 5th Ed. Chapter 20 14
Pooled Sample ProportionIf H0 is true (p1=p2), then the two proportions are equal to some common value p.Instead of estimating p1 and p2 separately, we will combine or pool the sample information to estimate p.This combined or pooled estimate is called the pooled sample proportion, and we will use it in place of each of the sample proportions in the expression for the standard error SE.
pooled sample proportionsamples both in nsobservatio of number total
samples both in successes of number total=p̂
BPS - 5th Ed. Chapter 20 15
Test Statistic for Two ProportionsUse the pooled sample proportion in place of each of the individual sample proportions in the expression for the standard error SE in the test statistic:
( ) ( )2
22
1
11
21
11n
p̂p̂n
p̂p̂p̂p̂z
−+−−
=( ) ( )
21
21
11
nˆˆ
nˆˆ
p̂p̂zpppp −+−
−=⇒
( ) ⎟⎟⎠
⎞⎜⎜⎝
⎛+−
−=⇒
21
21
111
nnp̂p̂
p̂p̂z
BPS - 5th Ed. Chapter 20 16
P-value for Testing Two ProportionsHa: p1 > p2
P-value is the probability of getting a value as large or larger than the observed test statistic (z) value.
Ha: p1 < p2P-value is the probability of getting a value as small or smaller than the observed test statistic (z) value.
Ha: p1 ≠ p2P-value is two times the probability of getting a value as large or larger than the absolute value of the observed test statistic (z) value.
BPS - 5th Ed. Chapter 20 17
BPS - 5th Ed. Chapter 20 18
Case Study
A university financial aid office polled a simple random sample of undergraduate students to study their summer employment.Not all students were employed the previous summer. Here are the results:
Is there evidence that the proportion of male students who had summer jobs differs from the proportion of female students who had summer jobs.
Summer Status Men WomenEmployed 718 593Not Employed 79 139Total 797 732
Summer Jobs
BPS - 5th Ed. Chapter 20 19
Null: The proportion of male students who had summer jobs is the same as the proportion of female students who had summer jobs. [H0: p1 = p2]
Alt: The proportion of male students who had summer jobs differs from the proportion of female students who had summer jobs. [Ha: p1 ≠ p2]
The HypothesesCase Study: Summer Jobs
BPS - 5th Ed. Chapter 20 20
Case Study: Summer Jobs
n1 = 797 and n2 = 732 (both large, so test statistic follows a Normal distribution)Pooled sample proportion:
standardized score (test statistic):15291311
732797593718 =
++=p̂
Test Statistic
075
7321
7971
152913111
15291311
732593
797718
.z =
⎟⎠⎞⎜
⎝⎛ +⎟⎠⎞⎜
⎝⎛ −
−=
BPS - 5th Ed. Chapter 20 21
Case Study: Summer Jobs1. Hypotheses: H0 : p1 = p2
Ha : p1 ≠ p2
2. Test Statistic:
3. P-value: P-value = 2P(Z > 5.07) = 0.000000396 (using a computer) P-value = 2P(Z > 5.07) < 2(1 – 0.9998) = 0.0004 (Table A)
[since 5.07 > 3.49 (the largest z-value in the table)]4. Conclusion:
Since the P-value is smaller than α = 0.001, there is very strong evidence that the proportion of male students who had summer jobs differs from that of female students.
075
7321
7971
152913111
15291311
732593
797718
.z =
⎟⎠⎞⎜
⎝⎛ +⎟⎠⎞⎜
⎝⎛ −
−=