Beruflich Dokumente
Kultur Dokumente
Hypothesis Testing –
Two Samples
Adapted From :
Probability & Statistics for Engineers & Scientists, 8th Ed.
Walpole/Myers/Myers/Ye (c)2007
Introduction to Business Statistics, 5e
Kvanli/Guynes/Pavur (c)2000
South-Western College Publishing
Statistics for Managers
Using Microsoft® Excel 4th Edition
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-1
Chapter Goals
After completing this chapter, you should be able to:
Test hypotheses for the difference between two
independent population means (standard deviations known
or unknown)
Test two means from related samples for the mean
difference
Complete a Z test for the difference between two
proportions
Use the F table to find critical F values
Complete an F test for the difference between two
variances
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-2
Two Sample Tests
Population
Means, Population Population Population
Independent Means, Paired Proportions Variances
Samples Observations
Examples:
Group 1 vs. Same group Proportion 1 vs. Variance 1 vs.
independent before vs. after Proportion 2 Variance 2
Group 2 treatment
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-3
Difference Between Two Means
X1 – X2
σ1 ≠ σ2 and unknown
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-4
Independent Samples
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-5
Difference Between Two Means
Population means,
independent
samples
*
σ1 and σ2 known Use a Z test statistic
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-6
σ1 and σ2 Known
Population standard
σ1 ≠ σ2 and unknown deviations are known
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-7
σ1 and σ2 Known
(continued)
Population means,
independent The test statistic for
samples μ1 – μ2 is:
σ1 and σ2 known * Z
X X μ μ
1 2 1 2
2 2
σ1 and σ2 unknown σ σ2
1
n1 n2
σ1 ≠ σ2 and unknown
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-9
Hypothesis Tests for
Two Population Means
Two Population Means, Independent Samples
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-10
Hypothesis tests for μ1 – μ2
Two Population Means, Independent Samples
Lower tail test: Upper tail test: Two-tailed test:
H0: μ1 – μ2 = 0 H0: μ1 – μ2 = 0 H0: μ1 – μ2 = 0
H1: μ1 – μ2 < 0 H1: μ1 – μ2 > 0 H1: μ1 – μ2 ≠ 0
a a a/2 a/2
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-11
σ1 and σ2 Unknown
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-12
σ1 and σ2 Unknown
(continued)
Population means,
independent
samples
The pooled standard
σ1 and σ2 known deviation is
σ1 ≠ σ2 and unknown
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-14
σ1 and σ2 Unknown
(continued)
X X μ
samples
μ2
t
1 2 1
σ1 and σ2 known
1 1
S
2
p
σ1 and σ2 unknown * n1 n 2
Where t has (n1 + n2 – 2) d.f.,
and
σ1 ≠ σ2 and unknown n1 1S1 n 2 1S2
2 2
S 2
(n1 n 2 1)
p
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-15
σ1 ≠ σ2 and Unknown
2
S
/ n1 S 22 / n2
2
2
σ1 ≠ σ2 and unknown
1
( S1 / n1 ) 2 /( n1 1) ( S 22 / n2 ) 2 /( n2 1)
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-17
Pooled Sp t Test: Example
You are a financial analyst for a brokerage firm. Is there
a difference in dividend yield between stocks listed on the
NYSE & NASDAQ? You collect the following data:
NYSE NASDAQ
Number 21 25
Sample mean 3.27 2.53
Sample std dev 1.30 1.16
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-18
Calculating the Test Statistic
The test statistic is:
t
X X μ μ
1
2 1 2 3.27 2.53 0 2.040
1 1 1 1
S
2
1.5021
21 25
p
n1 n2
n
S2 1
1S1
2
n 2 1S 2
2
21 11.30 2
25 11.16 2
1.5021
(n1 1) (n2 1) (21- 1) (25 1)
p
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-19
Solution
Reject H0 Reject H0
H0: μ1 - μ2 = 0 i.e. (μ1 = μ2)
H1: μ1 - μ2 ≠ 0 i.e. (μ1 ≠ μ2)
a = 0.05 .025 .025
df = 21 + 25 - 2 = 44 -2.0154 0 2.0154 t
Critical Values: t = ± 2.0154
2.040
Test Statistic: Decision:
3.27 2.53
t 2.040 Reject H0 at a = 0.05
1 1
1.5021 Conclusion:
21 25 There is evidence of a
difference in means.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-20
Paired Observations
Tests Means of 2 Related Populations
Related Paired or matched samples
samples Repeated measures (before/after)
Use difference between paired values:
D = X1 - X2
Eliminates Variation Among Subjects
Assumptions:
Both Populations Are Normally Distributed
Or, if Not Normal, use large samples
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-21
Mean Difference
The ith paired difference is Di , where
Related Di = X1i - X2i
samples
n
The point estimate for
the population mean
D i
D i 1
paired difference is D : n
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-22
Sample Standard Deviation
We can estimate the unknown
Related population standard deviation with a
samples sample standard deviation:
i
(D D ) 2
SD i 1
n 1
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-23
Mean Difference
(continued)
D μD
T
SD / n
n
Where t has n - 1 d.f. i
(D D ) 2
a a a/2 a/2
-21 n 1
5.67
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-26
Paired Samples: Solution
Has the training made a difference in the number of
complaints (at the 0.01 level)?
Reject Reject
H0: μD = 0
H1: μD 0
a/2 a/2
a = .01 D = - 4.2 - 4.604 4.604
- 1.66
Critical Value = ± 4.604
d.f. = n - 1 = 4
Decision: Do not reject H0
(t stat is not in the reject region)
Test Statistic:
Conclusion: There is not a
D μD 4.2 0
t 1.66 significant change in the
SD / n 5.67/ 5 number of complaints.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-27
Two Population Proportions
Goal: test a hypothesis or form a
Population confidence interval for the difference
proportions between two population proportions,
p1 – p2
Assumptions:
n1p1 5 , n1(1-p1) 5
n2p2 5 , n2(1-p2) 5
x1 x 2
pˆ
n1 n 2
Pˆ Pˆ p p
proportions
Z 1 2 1 2
p1q1 / n1 p2 q2 / n2
Pˆ1 Pˆ2
Z
pq(1 / n1 1 / n2 )
where X1 X 2 X X
p̂ , p̂ 1 1 , p̂ 2 2
n1 n 2 n1 n2
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-30
Hypothesis Tests for
Two Population Proportions
Population proportions
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-31
Hypothesis Tests for
Two Population Proportions
(continued)
Population proportions
Lower tail test: Upper tail test: Two-tailed test:
H0: p1 – p2 = 0 H0: p1 – p2 = 0 H0: p1 – p2 = 0
HA: p1 – p2 < 0 HA: p1 – p2 > 0 HA: p1 – p2 ≠ 0
a a a/2 a/2
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-32
Example:
Two population Proportions
Is there a significant difference between the
proportion of men and the proportion of
women who will vote Yes on Proposition A?
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-33
Example:
Two population Proportions
(continued)
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-34
Example:
Two population Proportions
(continued)
Reject H0 Reject H0
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-36
Hypothesis Tests for Variances
(continued)
F test statistic * S 2
2
S 22 = Variance of Sample 2
n2 - 1 = denominator degrees of freedom
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-37
The F Distribution
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-38
Finding the Rejection Region
H0: σ12 σ22
H0: σ12 = σ22
a H1: σ12 < σ22
H1: σ12 ≠ σ22
a/2
0 F a/2
Reject Do not
H0 FL reject H0
Reject H0 if F < FL 0 F
Reject Do not Reject H0
H0 FL reject H0 FU
H0: σ1 ≤ σ2 2 2
0 F
Reject Do not Reject H0
H0 FL reject H0 FU
To find the critical F values:
1
1. Find FU from the F table 2. Find FL using the formula: FL
FU*
for n1 – 1 numerator and
n2 – 1 denominator Where FU* is from the F table
degrees of freedom with n2 – 1 numerator and n1 – 1
denominator degrees of freedom
(i.e., switch the d.f. from FU)
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-40
F Test: An Example
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-41
Form the hypothesis test:
H0: σ21 – σ22 = 0 (there is no difference between variances)
H1: σ21 – σ22 ≠ 0 (there is a difference between variances)
S12 1.30 2
The test statistic is: F 2 2
1.256
S 2 1.16
FL = F (1- a/2) , n , d =
FU = Fa/2, n , d
= F.05, 20, 24 =1/F a/2, d , n = 1/F.05, 24, 20
= 2.03 = 1/2.08 = .48
1.256
0
Reject H0 Do not Reject H0
reject H0
FU=2.03 F
FL=0.48
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-42
F Test: Example Solution
(continued)
0 F
Reject H0 Do not Reject H0
reject H0
F = 1.256 is not in the FL=0.48
FU=2.03
rejection region, so we do not
reject H0
Conclusion: There is not sufficient evidence
of a difference in variances at a = 0.1
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-43
Form the hypothesis test:
H0: σ22 – σ21 = 0 (there is no difference between variances)
H1: σ22 – σ21 ≠ 0 (there is a difference between variances)
S 22 1.16 2
The test statistic is: F 2 2
0.796
S1 1.30
FL = F (1- a/2) , n , d
FU = Fa/2, n , d
= F.05, 24, 20 =1/F a/2, d , n = 1/F.05 , 20 . 24
= 2.08 = 1/2.03 = .493
0.796
0
Reject H0 Do not Reject H0
reject H0
FU=2.08 F
FL=0.493
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-44
F Test: Example Solution
(continued)
0 F
Reject H0 Do not Reject H0
reject H0
F = 0.796 is not in the rejection FL=0.493
FU=2.08
region, so we do not reject H0
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-45
F Test: An Example
JUMLAH KERUSAKAN
Perakitan A Perakitan B
Rata-rata 10 11
Varian 9 25
Ukuran sampel 20 16
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-46
F Test: An Example
1. Menentukan Hipotesis :
Ho : sA2 = sB2 ; varian kerusakan B tidak > varian A
H1 : sB2 > sA2 ; varian kerusakan B > varian A
3. Perhitungan Fs :
Fs = sB2 / sA2 = 25 / 9 = 2,78
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-47
F Test: An Example
4.
Penerimaan Ho
Penerimaan H1
2,78 3,15
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-48
F Test: An Example
Alternatif Lain :
1. Menentukan Hipotesis :
Ho : sA2 = sB2 ; varian kerusakan B tidak > varian A
H1 : sA2 < sB2 ; varian kerusakan B > varian A
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-49
F Test: An Example
Alternatif Lain :
4. Penerimaan H1
Penerimaan Ho
0,32 0,36
PROBLEM 2
National Park rangers were surveyed as to whether they endorsed the idea of carrying firearms. Of the
260 ranges polled west of the Mississippi, 78% endorsed the idea. Of the 184 rangers polled east of the
Mississippi, 64% endorsed the idea. Is there evidence that the level of support for carrying firearms is
BIGGER in the West than it is in the East ?
PROBLEM 3
You are comparing the precision of two brands of stamping machines. From a random sample of 12
units of output from Brand A machine, you find that it produces with a standard deviation of 15.2. For
the Brand B machine, in a sample of 20 units of output, you find a standard deviation of 10.1. Assume
that the output of both machines follows a normal distribution, and the population variances are equal.
Evaluate the null hypothesis of equal variances against the alternative hypothesis that Brand B machines
produce with lower variance a 0.10.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-51
Exercises
PROBLEM 4
Manajer pabrik sebuah perusahaan sari jeruk ingin membandingkan 2 proses produksi yang berbeda.
Proses produksi 1 relatif baru dan ia berasumsi proses produksi ini akan memberikan hasil yang lebih
baik daripada proses produksi 2. Sampel dari masing-masing proses dipilih secara acak dengan ukuran n1
= 40 dan n2 = 40. Diketahui pula dari rata-rata sampel 1, x1 = 824,9 liter /hari dan rata-rata sampel 2, x2
= 818,6 liter/hari. Berdasarkan pengalaman diketahui varian populasi 1, 12 = 40 dan 2 2 = 50. Pada
a 5% Ujilah hipotesis manajer pabrik !
PROBLEM 5 (9.6)
Notwithstanding the equal Pay Act of 1963, in 1993 it still appeared that men earned more than woman
in similar jobs. At random sample of 38 male machine tool operators found mean hourly wages of
$11.38, and the sample standard deviation was $1.84. A random sample of 45 female machine tool
operators found their mean wage to be $ 8.42 and the sample standard deviation was $1.31. On the
basis of these samples, is it reasonable to conclude at a 0.01 that the male operators are earning over
$2.00 more per hour than the female operators ?
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 9-52