Skip to main content
Elementary Statistics
Chapter 9: Inferences
from Two Samples
9.1 Two Proportions
1
Chapter 9: Inferences from Two Samples
9. 1 Two Proportions
9.2 Two Means: Independent Samples
9.3 Two Dependent Samples (Matched Pairs)
9.4 Two Variances or Standard Deviations
2
Objectives:
• Test the difference between two proportions.
• Test the difference between sample means, using the z test.
• Test the difference between two means for independent samples, using the t test.
• Test the difference between two means for dependent samples.
• Test the difference between two variances or standard deviations.
Synopsis:
1. Testing a claim made about two population proportions
2. Constructing a confidence interval estimate of the difference between two population
proportions. (in forms of probabilities or the decimal equivalents of percentages)
Objectives
1. Hypothesis Test: Conduct a hypothesis test of a claim about two population
proportions.
2. Confidence Interval: Construct a confidence interval estimate of the difference
between two population proportions.
9. 1 Two Proportions
3
1. The sample proportions are from two simple random samples.
2. The two samples are independent. (Samples are independent if the sample values
selected from one population are not related to or somehow naturally paired or matched
with the sample values from the other population.)
3. 𝑛𝑝 & 𝑛𝑞 ≥ 5 𝑓𝑜𝑟 𝑒𝑎𝑐ℎ 𝑠𝑎𝑚𝑝𝑙𝑒
For population 1 & 2:
4
9. 1 Inferences about Two Proportions
𝑝2 =
𝑥2
𝑛2
, 𝑞2 = 1 − 𝑝2
𝑝1 =
𝑥1
𝑛1
, 𝑞1 = 1 − 𝑝1
𝑝 =
𝑥1 + 𝑥2
𝑛1 + 𝑛2
𝑞 = 1 − 𝑝
The pooled sample proportion combines the two samples
proportions into one proportion & Test Statistic :
𝑇𝑆: 𝑧 =
(𝑝1 − 𝑝2) − (𝑝1 − 𝑝2)
𝑝𝑞
1
𝑛1
+
1
𝑛2
Or
(𝑝1 − 𝑝2) − (𝑝1 − 𝑝2)
𝑝𝑞
𝑛1
+
𝑝𝑞
𝑛2
Confidence Interval Estimate of p1 − p2
(𝑝1 − 𝑝2) − 𝑧𝛼
2
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
< 𝑝1 − 𝑝2 < (𝑝1 − 𝑝2) + 𝑧𝛼
2
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
(𝑝1 − 𝑝2) ± 𝐸
The P-value method and the critical value method are equivalent, but the confidence
interval method is not equivalent to the P-value method or the critical value method.
𝜎𝑝1−𝑝2
=
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
, 𝐸 = 𝑧𝛼/2
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
TI Calculator:
2 - Proportion Z - test
1. Stat
2. Tests
3. 2 ‒ PropZTest
4. Enter Data or Stats
𝒏𝟏 , 𝒏𝟐, 𝒙𝟏, 𝒙𝟐
5. Choose RTT, LTT,
or 2TT
TI Calculator:
Confidence Interval: 2
proportion
1. Stat
2. Tests
3. 2-prop ZINT
4. Enter:𝒏𝟏 , 𝒏𝟐, 𝒙𝟏, 𝒙𝟐 & CL
Step 4: Decision:
a. Reject H0
b. The claim is True
c. There is enough evidence to say that the
proportion of drivers who send text messages
is larger today than it was last year. 5
A survey of 1000 drivers this year showed that 29% of the people send text
messages while driving. Last year a survey of 1000 drivers showed that 17% of
those send text messages while driving. At α = 0.01, test the claim that there has
been an increase in the number of drivers who text while driving?
Example 1
Step 3: CV: α = 0.01 → 𝑧 = 2.33, Or 2.325
Step 1: H0: p1 = p2 & H1: p1 > p2 (claim), RTT
Given: BD, α = 0.01
𝒏𝟏 = 𝟏𝟎𝟎𝟎, 𝒑𝟏 = 𝟎. 𝟐𝟗,
𝒏𝟐 = 𝟏𝟎𝟎𝟎, 𝒑𝟐 =0.17
Step 1: H0 , H1, claim & Tails
Step 2: TS Calculate (TS)
Step 3: CV using α
Step 4: Make the decision to
a. Reject or not H0
b. The claim is true or false
c. Restate this decision: There
is / is not sufficient evidence
to support the claim that…
Step 2: 𝑇𝑆: 𝑧 =
0.29−0.17
0.23(0.77)
1000
+
0.23(0.77)
1000
= 6.38
𝑝 =
1000(0.29) + 1000(0.17)
1000 + 1000
= 0.23 → 𝑞 = 1 − 𝑝 = 0.77
𝑧 =
(𝑝1 − 𝑝2) − (𝑝1 − 𝑝2)
𝑝𝑞
1
𝑛1
+
1
𝑛2
𝑜𝑟
(𝑝1 − 𝑝2) − (𝑝1 − 𝑝2)
𝑝𝑞
𝑛1
+
𝑝𝑞
𝑛2
𝑝 =
𝑥1 + 𝑥2
𝑛1 + 𝑛2
6
Proportions of Cars with Rear License Plates Only: Are the
Proportions the Same in Connecticut and New York? Use a 0.05
significance level to test the claim that Connecticut and New York
have the same proportion of cars with rear license plates only.
Example 2 a: CV Method
CV: α = 0.05 → 𝑧 = ±1.96
H0: p1 = p2 , Claim & H1: p1 ≠ p2, 2TT
Given: BD, 𝒙𝟏 = 𝟐𝟑𝟗, 𝒏𝟏 = 𝟐𝟎𝟒𝟗, 𝒙𝟐 =
𝟗, 𝒏𝟐 = 𝟓𝟓𝟎, α = 0.05
𝑇𝑆: 𝑧 =
0.117 − 0.016
0.0954(0.9046)
2049
+
0.0954(0.9046)
550
= 7.11
𝑝1 =
𝑥1
𝑛1
=
239
2049
= 0.1166
𝑝2 =
𝑥2
𝑛2
=
9
550
= 0.0164
𝑝 =
𝑥1 + 𝑥2
𝑛1 + 𝑛2
=
239 + 9
2049 + 550
=
0.09542132 → 𝑞 = 0.90457868
Blank Connecticut New York
Cars with rear license
plate only
239 9
Cars with front and
rear license plates
1810 541
Total 2049 550
Decision:
a. Reject H0
b. The claim is False
c. There is not sufficient evidence to support the claim that p1 = p2. That is, there is
sufficient evidence to conclude that Connecticut and New York have different
proportions of cars with rear license plates only. It’s reasonable to speculate that
enforcement of the license plate laws is much stricter in New York than in
Connecticut, and that is why Connecticut car owners are less likely to install the
front license plate.
𝑧 =
𝑝1 − 𝑝2
𝑝𝑞
𝑛1
+
𝑝𝑞
𝑛2
TI Calculator:
2 - Proportion Z - test
1. Stat
2. Tests
3. 2 ‒ PropZTest
4. Enter Data or Stats
𝒏𝟏 , 𝒏𝟐, 𝒙𝟏, 𝒙𝟐
5. Choose RTT, LTT,
or 2TT
𝑝 =
𝑥1 + 𝑥2
𝑛1 + 𝑛2
7
Proportions of Cars with Rear License Plates Only: Are the
Proportions the Same in Connecticut and New York? Use a 0.05
significance level to test the claim that Connecticut and New York
have the same proportion of cars with rear license plates only.
a. By the Traditional (CV) Method
b. By The P-value Method
c. By Confidence Interval (90%) .
Example 2b: P-value Method
Given: BD, 𝒙𝟏 = 𝟐𝟑𝟗, 𝒏𝟏 = 𝟐𝟎𝟒𝟗,
𝒙𝟐 = 𝟗, 𝒏𝟐 = 𝟓𝟓𝟎, , 𝒑𝟏=𝒑𝟐=0.8, α
= 0.05
𝑝1 = 0.1166
𝑝2 == 0.0164
𝑝 = 0.09542132
𝑞 = 0.90457868
Blank Connecticut New York
Cars with rear license
plate only
239 9
Cars with front and
rear license plates
1810 541
Total 2049 550
2TT:
P-value = twice the area to the right of
the test statistic z = 7.11
The P-value: 2(0.0001) = 0.0002.
Technology: P-value = 0.00000000000119
which is often expressed as 0.0000
or “P-value < 0.0001.”
The P-value = 0.0000 < α = 0.05
Reject the null hypothesis of p1 = p2
8
Proportions of Cars with Rear License Plates Only:
Are the Proportions the Same in Connecticut and
New York? Use a 0.05 significance level to test the
claim that Connecticut and New York have the same
proportion of cars with rear license plates only.
a. By the Traditional (CV) Method
b. By The P-value Method
c. By Confidence Interval (95%) .
Example 2c: CI Method
Given: BD, 𝒙𝟏 = 𝟐𝟑𝟗,
𝒏𝟏 = 𝟐𝟎𝟒𝟗, 𝒙𝟐 = 𝟗,
𝒏𝟐 = 𝟓𝟓𝟎, , α = 0.05
𝐸 = 𝑧𝛼
2
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
𝐸 = 1.96
0.117(0.883)
2049
+
0.016(0.984)
550
= 1.96(0.008890763) = 0.017482
Interpretation: The confidence interval limits do not contain 0, suggesting that
there is a significant difference between the two proportions. The confidence
Interval suggests that the value of p1 is greater than the value of p2, so there appear
to be sufficient evidence to warrant rejection of the claim that “Connecticut and
New York have the same proportion of cars with rear license plates only.”
0.1166 − 0.0164 ± 0.0175
0.0828 < ( p1– p2) < 0.1178
(𝑝1 − 𝑝2) ± 𝐸
= 0.1003 ± 0.0175
TI Calculator:
Confidence Interval: 2
proportion
1. Stat
2. Tests
3. 2-prop ZINT
4. Enter:𝒏𝟏 , 𝒏𝟐, 𝒙𝟏, 𝒙𝟐 & CL
𝑝1 = 0.1166
𝑝2 == 0.0164
𝑝 = 0.09542132
𝑞 = 0.90457868
9
A researchers found that 12 out of 34 inner-city nursing homes had a flue
vaccination rate of less than 80%, while 17 out of 24 countryside nursing
homes had a flue vaccination rate of less than 80%. At α = 0.05, test the claim
that there is no difference in the proportions of the two nursing homes with a
flue vaccination rate of less than 80%.
Example 3: CV Method
Step 3: CV: α = 0.05 → 𝑧 = ±1.96
Step 1: H0: p1 – p2 = 0, Claim, H1: p1 – p2  0, 2TT
Given: BD, 𝒙𝟏 = 𝟏𝟐, 𝒏𝟏 = 𝟑𝟒, 𝒙𝟐 = 𝟏𝟕,
𝒏𝟐 = 𝟐𝟒, , 𝒑𝟏=𝒑𝟐=0.8, α = 0.05
Step 4: Decision:
a. Reject H0
b. The claim is False
c. There is not sufficient evidence to support the
claim that there is no difference in the
proportions of inner-city and countryside
nursing homes with a resident vaccination
rate of less than 80%.
Step 2: 𝑇𝑆: 𝑧 =
0.35−0.71
0.5(0.5)(
1
34
+
1
24
)
= −2.7
𝑝1 =
𝑋1
𝑛1
=
12
34
= 0.35 & 𝑝2 =
𝑋2
𝑛2
=
17
24
= 0.71
𝑝 =
𝑥1 + 𝑥2
𝑛1 + 𝑛2
=
12 + 17
34 + 24
=
29
58
= 0.5 → 𝑞 = 0.5
Step 1: H0 , H1, claim & Tails
Step 2: TS Calculate (TS)
Step 3: CV using α
Step 4: Make the decision to
a. Reject or not H0
b. The claim is true or false
c. Restate this decision: There
is / is not sufficient evidence
to support the claim that…
𝑧 =
𝑝1 − 𝑝2
𝑝𝑞
𝑛1
+
𝑝𝑞
𝑛2
TI Calculator:
2 - Proportion Z - test
1. Stat
2. Tests
3. 2 ‒ PropZTest
4. Enter Data or Stats
𝒏𝟏 , 𝒏𝟐, 𝒙𝟏, 𝒙𝟐
5. Choose RTT, LTT,
or 2TT
𝑝 =
𝑥1 + 𝑥2
𝑛1 + 𝑛2
10
A researchers found that 12 out of 34 inner-city nursing homes had a flue vaccination
rate of less than 80%, while 17 out of 24 countryside nursing homes had a flue
vaccination rate of less than 80%. At α = 0.05, test the claim that there is no difference
in the proportions of the small and large nursing homes with a flue vaccination rate of
less than 80%. Find the 95% confidence interval for the difference of the proportions.
Example 3: CI Method
Given: BD, 𝒙𝟏 = 𝟏𝟐, 𝒏𝟏 = 𝟒, 𝒙𝟐 =
𝟏𝟕, 𝒏𝟐 = 𝟐𝟒, , 𝒑𝟏=𝒑𝟐=0.8, α = 0.05
𝑝1 = 0.3529 & 𝑞1 = 0.6471
𝑝2 = 0.7083 & 𝑞2 = 0.2917
(𝑝1 − 𝑝2) − 𝑧𝛼
2
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
< 𝑝1 − 𝑝2 < (𝑝1 − 𝑝2) + 𝑧𝛼
2
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
𝐸 = 1.96
0.35(0.65)
34
+
0.71(0.29)
24
−0.36 − 0.242 < 𝑝1 − 𝑝2 < −0.36 + 0.242
−0.602 < 𝑝1 − 𝑝2 < −0.118
= 0.242
Since 0 is not
contained in the
interval, the decision is
to reject the null
hypothesis H0: p1 = p2.
(𝑝1 − 𝑝2) ± 𝐸
TI Calculator:
Confidence Interval: 2
proportion
1. Stat
2. Tests
3. 2-prop ZINT
4. Enter:𝒏𝟏 , 𝒏𝟐, 𝒙𝟏, 𝒙𝟐 & CL
11
For the sample data listed in, use a 0.05 significance level to test the claim
that the proportion of minority drivers stopped by the police is greater than
the proportion of white drivers who are stopped.
Example 4
Given: BD, 𝒏𝟏 = 𝟐𝟎𝟎, 𝒙𝟏 = 𝟐𝟒, 𝒑𝟏 = 𝟎. 𝟏𝟐,
𝒏𝟐 = 𝟏𝟒𝟎𝟎, 𝒙𝟐 = 𝟏𝟒𝟕, 𝒑𝟐 =0.105, α = 0.05
𝑝 =
𝑋1 + 𝑋2
𝑛1 + 𝑛2
=
24 + 147
200 + 1400
=
171
1600
= 0.106875
→ 𝑞 = 0.893125
Racial Profiling data Minority White & Non-Hispanic
Drivers stopped by police 24 147
Total 200 1400
% 24/200 = 12% 147/1400 = 10.5%
Step 4: Decision:
a. Fail to Reject H0
b. The claim is False
c. There is not sufficient evidence to support the claim that the
proportion of minority drivers stopped by police is greater than that
for white drivers. (This does not mean that racial profiling has been
disproved. The evidence might be strong enough with more data.) 12
For the sample data listed in, use a 0.05 significance level to test
the claim that the proportion of minority drivers stopped by the
police is greater than the proportion of white drivers who are
stopped.
Example 4: CV Method
Step 3: CV: α = 0.05 → 𝑧 = 1.645
Step 1: H0: p1 = p2 & H1: p1 > p2 (claim), RTT
Step 2: 𝑇𝑆: 𝑧 =
0.12−0.105
0.1069(0.8931)
200
+
0.1069(0.8931)
1400
= 0.6422
𝑝 = 0.106875
→ 𝑞 = 0.893125
Given: BD, 𝒏𝟏 = 𝟐𝟎𝟎,
𝒙𝟏 = 𝟐𝟒, 𝒑𝟏 = 𝟎. 𝟏𝟐,
𝒏𝟐 = 𝟏𝟒𝟎𝟎, 𝒙𝟐 =
𝟏𝟒𝟕, 𝒑𝟐 =0.105, α = 0.05
Step 1: H0 , H1, claim & Tails
Step 2: TS Calculate (TS)
Step 3: CV using α
Step 4: Make the decision to
a. Reject or not H0
b. The claim is true or false
c. Restate this decision: There
is / is not sufficient evidence
to support the claim that…
𝑧 =
(𝑝1 − 𝑝2) − (𝑝1 − 𝑝2)
𝑝𝑞
1
𝑛1
+
1
𝑛2
𝑜𝑟
(𝑝1 − 𝑝2) − (𝑝1 − 𝑝2)
𝑝𝑞
𝑛1
+
𝑝𝑞
𝑛2
13
For the sample data listed in, use a 0.05 significance level
to test the claim that the proportion of minority drivers
stopped by the police is greater than the proportion of
white drivers who are stopped.
a. By the Traditional (CV) Method
b. By The P-value Method
c. By Confidence Interval (90%) .
Example 4: P-value & CI Method
TS: z = 0.64
RTT: the P-value = The area to the right of the test
statistic: z = 0.64.
The P-value = 0.2611.
P-value = 0.2611 >  = 0.05
Fail to reject the null hypothesis.
𝐸 = 𝑧𝛼
2
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
𝐸 = 1.645
0.12(0.88)
200
+
0.105(0.895)
1400
= 0.0404
(0.120 – 0.105) – 0.0404 < ( p1– p2) < (0.120 – 0.105) + 0.0404
–0.025 < ( p1– p2) < 0.055
(𝑝1 − 𝑝2) ± 𝐸
Given: BD, 𝒏𝟏 = 𝟐𝟎𝟎,
𝒙𝟏 = 𝟐𝟒, 𝒑𝟏 = 𝟎. 𝟏𝟐,
𝒏𝟐 = 𝟏𝟒𝟎𝟎, 𝒙𝟐 =
𝟏𝟒𝟕, 𝒑𝟐 =0.105, α = 0.05
Why Do the Procedures of This Section Work?
14
The distribution of 𝑝1can be approximated by a normal distribution with mean p1, and standard
deviation: 𝑝1𝑞1/𝑛1
The difference 𝑝1 − 𝑞1 can be approximated by a normal distribution with mean p1 – p2 and variance:
The variance of the differences between two independent random variables is the sum of their individual
variances which leads to:
Therefore, the z test statistic has the form given earlier.
When constructing the confidence interval estimate of the difference between
two proportions, we don’t assume that the two proportions are equal, and we
estimate the standard deviation as
𝜎(𝑝1−𝑝2)
2
= 𝜎𝑝1
2
+ 𝜎𝑝2
2
=
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
𝜎(𝑝1−𝑝2) =
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
𝜎 =
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2
𝑧 =
(𝑝1 − 𝑝2) − (𝑝1 − 𝑝2)
𝑝1𝑞1
𝑛1
+
𝑝2𝑞2
𝑛2