Chapter 8
Inferences Based
on Two Samples:
Confidence
Intervals & Tests
of Hypotheses
8-1
8.1
Identifying the Target
Parameter
8-2
Thinking Challenge
How would you try to answer these
questions?
• Who gets higher • Which program is
grades: males or faster to learn: Word
females? or Excel?
8-3
Determining the Target
Parameter
Parameter Key Words or Phrases Type of Data
Mean difference; Quantitative
1 – 2 differences in averages
Differences between Qualitative
proportions, percentages,
p1 – p2 fractions, or rates;
compare proportions
( 1 )2 Ration of variances; Quantitative
differences in variability or
( 2 )2 spread; compare variation
8-4
8.2
Comparing Two Population
Means: Independent Sampling
8-5
Sampling Distribution
Population 1 2 Population
1 2
1 2
Select simple random Compute x1 – x2 Select simple random
sample, n1. Compute for every pair of sample, n2. Compute
x1 samples x2
Astronomical number Sampling
of x1 – x2 values Distribution
1 - 2
8-6
Large-Sample Confidence Interval
for (μ1 – μ2)
12 , 22 known:
12 22
(x1 − x2 ) z 2 (x − x ) = (x1 − x2 ) z 2
1 2
n1
+
n2
12 , 22 unknown:
s12 s22
( x1 − x2 ) z 2 ( x − x ) = ( x1 − x2 ) z 2 +
1 2
n1 n2
8-7
Large-Sample Test of
Hypothesis for (µ 1 – µ 2)
One-Tailed Test
H0: (µ 1 – µ 2) = D0
Ha: (µ 1 – µ 2) < D0 [or Ha: (µ 1 – µ 2) > D0 ]
where D0 = Hypothesized difference between the
means (the difference is often hypothesized to be
equal to 0)
z=
(x1 − x2 )− D0
(x1 − x2 ) =
12 22
+
Test statistic: (x −x )
1 2
n 1 n2
Rejection region: z < –z s12 s22
[or z > z when Ha: (µ 1 – µ 2) > D0 ] +
n1 n2
8-8
Large-Sample Test of
Hypothesis for (µ 1 – µ 2)
Two-Tailed Test
H0: (µ 1 – µ 2) = D0
Ha: (µ 1 – µ 2) ≠ D0
where D0 = Hypothesized difference between the
means (the difference is often hypothesized to be
equal to 0) 2
1 22
(x1 − x2 )− D0 (x − x ) =
n1
+
n2
Test statistic: z =
1 2
(x −x )
s12 s22
1 2
Rejection region: |z| > z2 +
n1 n2
8-9
Conditions Required for Valid Large-
Sample Inferences about
(μ1 – μ2)
1. The two samples are randomly selected in an
independent manner from the two target populations.
2. The sample sizes, n1 and n2, are both large (i.e., n1 ≥
30 and n2 ≥ 30). [Due to the Central Limit Theorem,
this condition guarantees that the sampling
distribution of (x1 − x2 ) will be approximately normal
regardless of the shapes of the underlying probability
2 2
distributions of the populations. Also, s1 and s2 will
provide good approximations to 1 and 2 when the
2 2
samples are both large.]
8-10
Large-Sample Confidence
Interval Example
You’re a financial analyst for Charles Schwab.
You want to estimate the difference in dividend
yield between stocks listed on NYSE and
NASDAQ. You collect the following data:
NYSE NASDAQ
Number 121 125
Mean 3.27 2.53
Std Dev 1.30 1.16
What is the 95% confidence interval
for the difference between the mean
dividend yields?
© 1984-1994 T/Maker Co.
8-11
Large-Sample Confidence
Interval Solution
s12 s22
( x1 − x2 ) z 2 +
n1 n2
(1.3) 2 (1.16) 2
(3.27 − 2.53) 1.96 +
121 125
.43 1 − 2 1.05
8-12
Hypotheses for Means of Two
Independent Populations
Research Questions
No Difference Pop 1 Pop 2 Pop 1 Pop 2
Hypothesis Any Difference Pop 1 < Pop 2 Pop 1 > Pop 2
H0 1 − 2 = 0 1 − 2 0 1 − 2 0
Ha 1 − 2 0 1 − 2 0 1 − 2 0
8-13
Large-Sample Test
Example
You’re a financial analyst for Charles
Schwab. You want to find out if there is a
difference in dividend yield between stocks
listed on NYSE and NASDAQ. You collect
the following data:
NYSE NASDAQ
Number 121 125
Mean 3.27 2.53
Std Dev 1.30 1.16
Is there a difference in average
yield ( = .05)?
© 1984-1994 T/Maker Co.
8-14
Large-Sample Test
Solution
• H0: 1 - 2 = 0 (1 = 2)
Test Statistic:
• Ha: 1 - 2 0 (1 2)
(3.27 − 2.53) − 0
• =.05 z= = +4.71
2
2 2
• 1.30
1.69 1.16
n1= 121 , n2 =125 +
• Critical Value(s): 121 125
Decision:
Reject H0 Reject H0 Reject at = .05
.025 .025
Conclusion:
There is evidence of a
-1.96 0 1.96 z difference in means
8-15
Large-Sample Test
Thinking Challenge
You’re an economist for the Department of
Education. You want to find out if there is a
difference in spending per pupil between urban
and rural high schools. You collect the following:
Urban Rural
Number 35 35
Mean $ 6,012 $ 5,832
Std Dev $ 602 $ 497
Is there any difference in population
means ( = .10)?
8-16
Large-Sample Test
Solution*
• H0: 1 - 2 = 0 (1 = 2)
Test Statistic:
• Ha: 1 - 2 0 (1 2)
(6012 − 5832) − 0
• =.10 z = = +1.36
6022 497 2
• n1 = 35 , n2 =35 +
35 35
• Critical Value(s):
Decision:
Reject H 0 Reject H0 Do not reject at = .10
.05 .05
Conclusion:
There is no evidence of a
-1.645 0 1.645 z difference in means
8-17
Exercise
8-18
Small-Sample Confidence
Interval for (μ1 – μ2)
(Independent Samples)
1 1
(x 1 )
− x 2 t 2
s +
2
p
n1 n2
2
=
(n1 − 1) s12 + (n2 − 1) s22
where s p
n1 + n2 − 2
and t/2 is based on (n1 + n2 – 2) degrees of freedom.
8-19
Small-Sample Test of
Hypothesis for (µ 1 – µ 2)
One-Tailed Test
H0: (µ 1 – µ 2) = D0
Ha: (µ 1 – µ 2) < D0 [or Ha: (µ 1 – µ 2) > D0 ]
Test statistic: t =
(x1 − x2 )− D0
1 1
s 2p +
n1 n2
Rejection region: t < –t
[or t > t when Ha: (µ 1 – µ 2) > D0 ]
where t is based on (n1 + n2 – 2) degrees of freedom.
8-20
Small-Sample Test of
Hypothesis for (µ 1 – µ 2)
Two-Tailed Test
H0: (µ 1 – µ 2) = D0
Ha: (µ 1 – µ 2) ≠ D0
t=
(x1 − x2 )− D0
Test statistic: 1 1
s 2p +
n1 n2
Rejection region: |t| > t /2
where t/2 is based on (n1 + n2 – 2) degrees of freedom.
8-21
Conditions Required for Valid
Small-Sample Inferences about
(μ1 – μ2)
1. The two samples are randomly selected in an
independent manner from the two target
populations.
2. Both sampled populations have distributions that
are approximately normal.
3. The populations variances are equal
(i.e., 12 = 22 ).
8-22
2-sample t-test using pooled
variances (Same Variance)
1. An informal check for this is to compare the ratio of the
two sample standard deviations. If the two are equal,
this ratio would be 1. However, since these are samples
and therefore involve error, we cannot expect the ratio to
be exactly 1.
2. When the sample sizes are nearly equal, then a good
Rule of Thumb to use is to see if this ratio falls from 0.5
to 2 (that is neither sample standard deviation is more
than twice the other). If this rule of thumb is satisfied we
can assume the variances are equal.
8-23
Small-Sample Confidence
Interval Example
You’re a financial analyst for Charles Schwab. You
want to estimate the difference in dividend yield
between stocks listed on the NYSE and NASDAQ.
You collect the following data:
NYSE NASDAQ
Number 11 15
Mean 3.27 2.53
Std Dev 1.30 1.16
Assuming normal populations, what
is the 95% confidence interval
for the difference between the
mean dividend yields?
© 1984-1994 T/Maker Co.
8-24
Small-Sample Confidence
Interval Solution
df = n1 + n2 – 2 = 11 + 15 – 2 = 24 t.025 = 2.064
s 2p =
( n1 − 1) s12 + ( n2 − 1) s22
n1 + n2 − 2
(11 − 1)(1.30 ) + (15 − 1)(1.16 )
2 2
= = 1.489
11 + 15 − 2
1 1
(3.27 − 2.53) 2.064 1.489 +
11 15
−.26 1 − 2 1.74
8-25
Small-Sample Test
Example
You’re a financial analyst for Charles Schwab.
Is there a difference in dividend yield between
stocks listed on the NYSE and NASDAQ?
You collect the following data:
NYSE NASDAQ
Number 11 15
Mean 3.27 2.53
Std Dev 1.30 1.16
Assuming normal populations,
and equal population variances,
is there a difference in average
yield ( = .05)?
© 1984-1994 T/Maker Co.
8-26
Small-Sample Test
Solution
• H0: 1 – 2 = 0 (1 = 2)
• Ha: 1 – 2 0 (1 2)
• = .05
• df = 11 + 15 – 2 = 24
• Critical Value(s):
Reject H 0 Reject H 0
.025 .025
-2.064 0 2.064 t
8-27
Small-Sample Test
Solution
s 2
=
( n1 − 1) s12 + ( n2 − 1) s22
n1 + n2 − 2
p
(11 − 1)(1.30 ) + (15 − 1)(1.16 )
2 2
= = 1.489
11 + 15 − 2
t=
( x1 − x2 ) − ( 1 − 2 ) = ( 3.27 − 2.53) − ( 0 ) = +1.53
1 1 1 1
s 2p + 1.489 +
n1 n2 11 15
8-28
Small-Sample Test
Solution
• H0: 1 – 2 = 0 (1 = 2) Test Statistic:
• Ha: 1 – 2 0 (1 2)
t = + 1 .5 3
• = .05
• df = 11 + 15 – 2 = 24
• Critical Value(s):
Decision:
Reject H 0 Reject H 0 Do not reject at = .05
.025 .025 Conclusion:
There is no evidence of a
-2.064 0 2.064 t difference in means
8-29
Small-Sample Test
Thinking Challenge
You’re a research analyst for General Motors.
Assuming equal variances, is there a difference in
the average miles per gallon (mpg) of two car
models ( = .05)?
You collect the following:
Sedan Van
Number 15 11
Mean 22.00 20.27
Std Dev 4.77 3.64
8-30
Small-Sample Test
Solution*
• H0: 1 – 2 = 0 (1 = 2)
• Ha: 1 – 2 0 (1 2)
• = .05
• df = 15 + 11 – 2 = 24
• Critical Value(s):
Reject H 0 Reject H 0
.025 .025
-2.064 0 2.064 t
8-31
Small-Sample Test
Solution*
s 2
=
( n1 − 1) s12 + ( n2 − 1) s22
n1 + n2 − 2
p
(15 − 1)( 4.77 ) + (11 − 1)( 3.64 )
2 2
= = 18.793
15 + 11 − 2
t=
( x1 − x2 ) − ( 1 − 2 ) = ( 22.00 − 20.27 ) − ( 0 ) = +1.00
1 1 1 1
s 2p + 18.793 +
n1 n2 15 11
8-32
Small-Sample Test
Solution*
• H0: 1 – 2 = 0 (1 = 2) Test Statistic:
• Ha: 1 – 2 0 (1 2)
• = .05 t = + 1 .0 0
• df = 15 + 11 – 2 = 24
• Critical Value(s):
Decision:
Reject H 0 Reject H 0 Do not reject at = .05
.025 .025 Conclusion:
There is no evidence of a
-2.064 0 2.064 t difference in means
8-33
Exercise
• In a packing plant, a machine packs cartons with jars. It is
supposed that a new machine will pack faster on the
average than the machine currently used. To test that
hypothesis, the times it takes each machine to pack ten
cartons are recorded. The results, in seconds, are shown
in the following table.
• Do the data provide sufficient evidence to conclude that,
on the average, the new machine packs faster? Perform
the required hypothesis test at the 5% level of
significance. Test the conditions required for valid small-
sample inferences first.
8-34
Approximate Small-Sample
Procedures when 1 2
2 2
1. Equal sample sizes (n1 = n2 = n)
Confidence interval: (x1 − x2 ) t 2 (s 2
1 )
+ s22 n
Test statistic H0: (1 − 2 ) = 0
t = (x1 − x2 ) (s 2
1 )
+ s22 n
where t is based on v = n1 + n2 – 2 = 2(n – 1)
degrees of freedom.
8-35
Approximate Small-Sample
Procedures when 1 2
2 2
2. Unequal sample sizes (n1 ≠ n2)
Confidence interval: (x1 − x2 ) t 2 (s2
1 ) (
n1 + s22 n2 )
Test statistic H0: (1 − 2 ) = 0
t = (x1 − x2 ) (s
2
1 ) (
n1 + s22 n2 )
where t is based on degrees of freedom equal to . . .
8-36
Approximate Small-Sample
Procedures when 1 2
2 2
v=
(s 2
1 n1 + s22 n2 )2
(s
2
1 n1 ) + (s
2 2
2 n2 )
2
n1 − 1 n2 − 1
Note: The value of v will generally not be an
integer. Round v down to the nearest integer
to use the t-table.
8-37
Exercise
• Independent random samples of 17 sophomores and 13
juniors attending a large university yield the following
data on grade point averages.
• At the 5% significance level, do the data provide
sufficient evidence to conclude that the mean GPAs of
sophomores and juniors at the university differ? (Check
Assumptions first)
8-38
What Should You Do if the
Assumptions Are Not Satisfied?
If you are concerned that the assumptions
are not satisfied, use the Wilcoxon rank
sum test for independent samples to test
for a shift in population distributions.
8-39
Parametric Statistical Test
• Involves population parameters
— Example: population mean
• Requires interval scale or ratio scale
— Whole numbers or fractions
— Example: height in inches (72, 60.5, 54.7)
• Has stringent assumptions
— Example: normal distribution
• Examples: z-test, t-test, F-test, 2-test
8-40
Distribution-Free Tests
Distribution-free tests are statistical tests that do
not rely on any underlying assumptions about the
probability distribution of the sampled population.
The branch of inferential statistics devoted to
distribution-free tests is called nonparametrics.
Nonparametric statistics (or tests) based on the
ranks of measurements are called rank statistics(
秩統計量) (rank tests).
8-41
Wilcoxon Rank Sum Test
The Wilcoxon rank sum test can be used to test
the hypothesis that the probability distribution
associated with the two populations are equivalent.
To compare the probability distributions of two
populations using a nonparametric test, rank the
sample observations as though they were all drawn
from the same population.
The test statistic for the Wilcoxon test is based on
the ranks for each of the two samples (rank sums).
8-42
Wilcoxon Rank Sum Test:
Independent Samples
Let D1 and D2 represent the probability
distributions for populations 1 and 2, respectively.
One-Tailed Test
H0: D1 and D2 are identical
Ha: D1 is shifted to the right of D2
[or D1 is shifted to the left of D2]
Test statistic:
T1, if n1 < n2; T2, if n2 < n1
(Either rank sum can be used if n1 = n2.)
8-43
Wilcoxon Rank Sum Test:
Independent Samples
Rejection region:
T1: T1 ≥ TU [or T1 ≤ TL]
T2: T2 ≤ TL [or T2 ≥ TU]
where TL and TU are obtained from Table XII
of Appendix D
Ties: Assign tied measurements the average of the
ranks they would receive if they were unequal but
occurred in successive order. For example, if the
third-ranked and fourth-ranked measurements are
tied, assign each a rank of (3 + 4)/2 = 3.5
8-44
Wilcoxon Rank Sum Test:
Independent Samples
Let D1 and D2 represent the probability
distributions for populations 1 and 2, respectively.
Two-Tailed Test
H0: D1 and D2 are identical
Ha: D1 is shifted to the left or to the right of D2
Test statistic:
T1, if n1 < n2; T2, if n2 < n1
(Either rank sum can be used if n1 = n2.) We will
denote this rank sum as T.
8-45
Wilcoxon Rank Sum Test:
Independent Samples
Rejection region:
T ≤ TL or T ≥ TU
where TL and TU are obtained from Table XII
of Appendix D
Ties: Assign tied measurements the average of the
ranks they would receive if they were unequal but
occurred in successive order. For example, if the
third-ranked and fourth-ranked measurements are
tied, assign each a rank of (3 + 4)/2 = 3.5
8-46
Conditions Required for Valid
Wilcoxon Rank Sum Test
1. The two samples are random and
independent.
2. The two probability distributions from
which the samples are drawn are
continuous.
8-47
Wilcoxon Rank Sum Test
Procedure
1. Assign ranks, Ri, to the n1 + n2 sample
observations
• If unequal sample sizes, let n1 refer to smaller-
sized sample
• Smallest value = 1
• Average ties
2. Sum the ranks, Ti, for each sample
3. Test statistic is Ti (smallest sample)
8-48
Example
You’re a production planner. You want to
see if the operating rates for two factories is
the same. For factory 1, the rates (% of
capacity) are 85, 82, 94, and 97. For factory
2, the rates are 71, 82, 77, 92, and 88 . Do
the factory rates have the same probability
distributions at the
.10 level of significance?
8-49
Wilcoxon Rank Sum Test
Solution
• H0: Identical Distrib.
• Ha: Shifted Left or Right
• = .10
• n1 =4 n2 = 5
• Critical Value(s):
8-50
Wilcoxon Rank Sum
Table (Portion)
= .05 one-tailed; = .10 two-tailed
n1
3 4 5 ..
TL T U TL TU TL TU ..
3 6 15 7 17 7 20 ..
n2 4 7 17 12 24 13 27 ..
5 7 20 13 27 19 36 ..
: : : : : : : :
8-51
Wilcoxon Rank Sum Test
Solution
• H0: Identical Distrib.
• Ha: Shifted Left or Right
• = .10
• n1 = 4 n2 = 5
• Critical Value(s):
Reject Do Not Reject
H0 Reject H0 H0
13 27 Ranks
8-52
Wilcoxon Rank Sum Test
Computation Table
Factory 1 Factory 2
Rate Rank Rate Rank
85 5 71 1
82 3 3.5 82 4 3.5
94 8 77 2
97 9 92 7
... 88 6
Rank Sum 25.5 19.5
8-53
Wilcoxon Rank Sum Test
Solution
• H0: Identical Distrib. Test Statistic:
• Ha: Shifted Left or Right T1 = 5 + 3.5 + 8+ 9 = 25.5
• = .10 (Smallest sample)
• n1 = 4 n2 = 5
• Critical Value(s):
Decision:
Do not reject at = .10
Reject Do Not Reject
H0 Reject H0 H0 Conclusion:
There is no evidence
13 27 Ranks
distrib. are not identical
8-54