Bsafc4 PPT Ch10 (Anova) - Compressed
Bsafc4 PPT Ch10 (Anova) - Compressed
Bsafc4 PPT Ch10 (Anova) - Compressed
4th Edition
Chapter 10
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-1
Learning Objectives
In this chapter, you learn hypothesis testing
procedures to test:
The means of two independent populations
The means of two related populations
The proportions of two independent populations
The variances of two independent populations
The means of more than two populations
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-2
Chapter Overview
One-Way Analysis
Two-Sample Tests
of Variance (ANOVA)
Population Means,
Independent Samples F-test
Means,
Related Samples
Tukey-Kramer
Population test
Proportions
Population
Variances
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-3
Two-Sample Tests
Two-Sample Tests
Population
Means, Means, Population Population
Independent Related Proportions Variances
Samples Samples
Examples:
Mean 1 vs. Same population Proportion 1 vs. Variance 1 vs.
independent before vs. after Proportion 2 Variance 2
Mean 2 treatment
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-4
Difference Between Two Means
Population means,
independent
samples
*
σ1 and σ2 known Use a Z test statistic
Population means,
independent The test statistic for
samples μ1 – μ2 is:
σ1 and σ2 known * Z
X1
X2 μ1 μ2
2 2
σ1 and σ2 unknown, σ σ2
assumed equal
1
n1 n2
σ1 and σ2 unknown,
not assumed equal
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-10
Hypothesis Tests for
Two Population Means
Two Population Means, Independent Samples
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-11
Hypothesis tests for μ1 – μ2
Two Population Means, Independent Samples
Lower-tail test: Upper-tail test: Two-tail 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
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-12
Confidence Interval,
σ1 and σ2 Known
Population means,
independent The confidence interval for
samples μ1 – μ2 is:
σ1 and σ2 known *
2 2
σ σ2
X1 X 2 Z 1
σ1 and σ2 unknown, n1 n2
assumed equal
σ1 and σ2 unknown,
not assumed equal
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-13
σ1 and σ2 Unknown,
Assumed Equal
Population means,
independent
samples
The pooled variance is
σ1 and σ2 known
n1 1S
2
n2 1S 2
2
σ1 and σ2 unknown,
assumed equal
* S 2
p 1
(n1 1) (n2 1)
σ1 and σ2 unknown,
not assumed equal
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-16
σ1 and σ2 Unknown,
Assumed Equal
(continued)
X X μ μ
samples
t
1 2 1 2
σ1 and σ2 known
1 1
S
2
σ1 and σ2 unknown,
assumed equal
* p
n1 n2
Where t has (n1 + n2 – 2) d.f.,
and
σ1 and σ2 unknown, n1 1S1 n2 1S2
2 2
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-17
Confidence Interval,
σ1 and σ2 Unknown
Population means,
The confidence interval for
independent
samples μ1 – μ2 is:
σ1 and σ2 known
X X t
1 2 n1 n2 -2
1 1
S
2
p
n1 n2
σ1 and σ2 unknown,
assumed equal
*
Where
σ1 and σ2 unknown, n
S2 1
1 S1
2
n 2 1 S 2
2
(n1 1) (n2 1)
p
not assumed equal
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-18
Pooled-Variance 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
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
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-20
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.
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-21
σ1 and σ2 Unknown,
Not Assumed Equal
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-22
σ1 and σ2 Unknown,
Not Assumed Equal
(continued)
Population means,
independent Forming the test statistic:
samples
The population variances
are not assumed equal, so
σ1 and σ2 known include the two sample
variances in the computation
σ1 and σ2 unknown, of the t-test statistic
assumed equal
the test statistic is a t value
σ1 and σ2 unknown,
not assumed equal
* (statistical software is generally
used to do the necessary
computations)
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-23
σ1 and σ2 Unknown,
Not Assumed Equal
(continued)
Population means,
independent The test statistic for
samples
μ1 – μ2 is:
X X μ μ
σ1 and σ2 known
t
1 2 1 2
σ1 and σ2 unknown, 2 2
S S
assumed equal
1 2
n1 n2
σ1 and σ2 unknown,
not assumed equal
*
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-24
Related Populations
Tests Means of 2 Related Populations
Related Paired or matched samples
samples Repeated measures (before/after)
Use difference between paired values:
Di = X1i - X2i
Eliminates Variation Among Subjects
Assumptions:
Both Populations Are Normally Distributed
Or, if not Normal, use large samples
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-25
Mean Difference, σD Known
The ith paired difference is Di , where
Related Di = X1i - X2i
samples
n
The point estimate for
the population mean
D i
D i1
paired difference is D : n
Suppose the population
standard deviation of the
difference scores, σD, is known
n is the number of pairs in the paired sample
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-26
Mean Difference, σD Known
(continued)
The test statistic for the mean
Paired difference is a Z value:
samples
D μD
Z
σD
n
Where
μD = hypothesized mean difference
σD = population standard dev. of differences
n = the sample size (number of pairs)
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-27
Confidence Interval, σD Known
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-28
Mean Difference, σD Unknown
If σD is unknown, we can estimate the
Related unknown population standard deviation
samples with a sample standard deviation:
n
The sample standard
deviation is i
(D D ) 2
SD i 1
n 1
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-29
Mean Difference, σD Unknown
(continued)
(D D)
i
2
where SD i1
n 1
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-31
Hypothesis Testing for
Mean Difference, σD Unknown
Paired Samples
a a a/2 a/2
M.O. 4 0 - 4
n 1
-21
5.67
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-33
Paired t Test: 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
X1 X 2
p
n1 n2
where X1 and X2 are the numbers from
samples 1 and 2 with the characteristic of
interest
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-36
Two Population Proportions
(continued)
Z
p1 p2 π1 π2
1 1
p (1 p)
n1 n2
X1 X 2 X X
where p , p1 1 , p 2 2
n1 n2 n1 n2
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-37
Confidence Interval for
Two Population Proportions
p1(1 p1 ) p2 (1 p2 )
p1 p2 Z
n1 n2
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-38
Hypothesis Tests for
Two Population Proportions
Population proportions
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-39
Hypothesis Tests for
Two Population Proportions
(continued)
Population proportions
Lower-tail test: Upper-tail test: Two-tail 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
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-40
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?
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-41
Example:
Two population Proportions
(continued)
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-42
Example:
Two population Proportions
(continued)
Reject H0 Reject H0
The test statistic for π1 – π2 is:
.025 .025
z
p1 p2 1 2
1 1
p (1 p) -1.96 1.96
n1 n2 -1.31
.50 .62 0 1.31
1 1 Decision: Do not reject H0
.549 (1 .549)
72 50
Conclusion: There is not
significant evidence of a
Critical Values = ±1.96
For a = .05 difference in proportions
who will vote yes between
men and women.
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-43
Two-Sample Tests
Two-Sample Tests
Population
Means, Means, Population Population
Independent Related Proportions Variances
Samples Samples
Examples:
Mean 1 vs. Same population Proportion 1 vs. Variance 1 vs.
independent before vs. after Proportion 2 Variance 2
Mean 2 treatment
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-44
Hypothesis Tests for Variances
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-45
Hypothesis Tests for Variances
(continued)
F test statistic * S 2
2
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-46
The F Distribution
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-47
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: σ12 ≤ σ22
H1: σ12 > σ22 rejection
S12
F 2 FU
a region for a S2
two-tail test is:
0 S12
F 2 FL
Do not Reject H0 F S2
reject H0 FU
Reject H0 if F > FU
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-48
Finding the Rejection Region
(continued)
H0: σ12 = σ22
a/2 H1: σ12 ≠ σ22
a/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)
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-49
F Test: An Example
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-50
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-51
F Test: Example Solution
Form the hypothesis test:
H0: σ21 – σ22 = 0 (there is no difference between variances)
H1: σ21 – σ22 ≠ 0 (there is a difference between variances)
0 F
Reject H0 Do not Reject H0
reject H0
F = 1.256 is not in the rejection FL=0.43
FU=2.33
region, so we do not reject H0
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-53
Exercise
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-54
Two-Sample Tests in EXCEL
For independent samples:
Independent sample Z test with variances known:
Tools | data analysis | z-test: two sample for means
Pooled variance t test:
Tools | data analysis | t-test: two sample assuming equal variances
Separate-variance t test:
Tools | data analysis | t-test: two sample assuming unequal variances
For variances:
F test for two variances:
Tools | data analysis | F-test: two sample for variances
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-55
One-Way Analysis of Variance
F-test Tukey-Kramer
test
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-56
General ANOVA Setting
Investigator controls one or more independent
variables
Called factors (or treatment variables)
Each factor contains two or more levels (or groups or
categories/classifications)
Observe effects on the dependent variable
Response to levels of independent variable
Experimental design: the plan used to collect
the data
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-57
One-Way Analysis of Variance
Assumptions
Populations are normally distributed
Populations have equal variances
Samples are randomly and independently drawn
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-58
Hypotheses of One-Way ANOVA
H0 : μ1 μ2 μ3 μc
All population means are equal
i.e., no treatment effect (no variation in means among
groups)
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-59
One-Way ANOVA
H0 : μ1 μ2 μ3 μc
H1 : Not all μ j are the same
μ1 μ2 μ3
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-60
One-Way ANOVA
(continued)
H0 : μ1 μ2 μ3 μc
H1 : Not all μ j are the same
At least one mean is different:
The Null Hypothesis is NOT true
(Treatment Effect is present)
or
μ1 μ2 μ3 μ1 μ2 μ3
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-61
Partitioning the Variation
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-62
Partitioning the Variation
(continued)
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-63
Partition of Total Variation
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-64
Total Sum of Squares
SST = SSA + SSW
c nj
SST ( Xij X) 2
j1 i1
Where:
SST = Total sum of squares
c = number of groups (levels or treatments)
nj = number of observations in group j
Xij = ith observation from group j
X = grand mean (mean of all data values)
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-65
Total Variation
(continued)
Response, X
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-66
Among-Group Variation
SST = SSA + SSW
c
SSA n j ( X j X) 2
j1
Where:
SSA = Sum of squares among groups
c = number of groups
nj = sample size from group j
Xj = sample mean from group j
X = grand mean (mean of all data values)
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-67
Among-Group Variation
(continued)
c
SSA n j ( X j X) 2
j1
SSA
Variation Due to
MSA
Differences Among Groups
c 1
Mean Square Among =
SSA/degrees of freedom
i j
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-68
Among-Group Variation
(continued)
SSA n1 ( x1 x ) n2 ( x 2 x ) ... nc ( x c x )
2 2 2
Response, X
X3
X2 X
X1
SSW ( Xij X j ) 2
j1 i1
Where:
SSW = Sum of squares within groups
c = number of groups
nj = sample size from group j
Xj = sample mean from group j
Xij = ith observation in group j
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-70
Within-Group Variation
(continued)
c nj
SSW ( Xij X j ) 2
j1 i1
SSW
Summing the variation
MSW
within each group and then
adding over all groups nc
Mean Square Within =
SSW/degrees of freedom
μj
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-71
Within-Group Variation
(continued)
Response, X
X3
X2
X1
SSA
MSA
c 1
SSW
MSW
nc
SST
MST
n 1
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-73
One-Way ANOVA Table
Source of SS df MS F ratio
Variation (Variance)
Among SSA MSA
SSA c-1 MSA = F=
Groups c-1 MSW
Within SSW
SSW n-c MSW =
Groups n-c
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-74
One-Way ANOVA
F Test Statistic
H0: μ1= μ2 = … = μc
H1: At least two population means are different
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-75
Interpreting One-Way ANOVA
F Statistic
The F statistic is the ratio of the among
estimate of variance and the within estimate
of variance
The ratio must always be positive
df1 = c -1 will typically be small
df2 = n - c will typically be large
Decision Rule:
Reject H0 if F > FU, a = .05
otherwise do not
reject H0 0 Do not Reject H0
reject H0
FU
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-76
One-Way ANOVA
F Test Example
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-77
One-Way ANOVA Example:
Scatter Diagram
Distance
Club 1 Club 2 Club 3 270
254 234 200 260 •
•
263 218 222 250 • X1
241 235 197 240 •
237 227 206 • ••
251 216 204 230
• X
220 ••
X2 •
210
x1 249.2 x 2 226.0 x 3 205.8
•• X3
200 ••
x 227.0 190
1 2 3
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Club Chap 10-78
One-Way ANOVA Example
Computations
Club 1 Club 2 Club 3 X1 = 249.2 n1 = 5
254 234 200 X2 = 226.0 n2 = 5
263 218 222
X3 = 205.8 n3 = 5
241 235 197
237 227 206 n = 15
X = 227.0
251 216 204 c=3
SSA = 5 (249.2 – 227)2 + 5 (226 – 227)2 + 5 (205.8 – 227)2 = 4716.4
SSW = (254 – 249.2)2 + (263 – 249.2)2 +…+ (204 – 205.8)2 = 1119.6
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-79
One-Way ANOVA Example
Solution
H0: μ1 = μ2 = μ3 Test Statistic:
H1: μj not all equal
MSA 2358.2
a = 0.05 F 25.275
df1= 2 df2 = 12 MSW 93.3
Critical Decision:
Value:
Reject H0 at a = 0.05
FU = 3.89
a = .05 Conclusion:
There is evidence that
0 Do not Reject H0 at least one μj differs
reject H0 F = 25.275
FU = 3.89 from the rest
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-80
One-Way ANOVA
Excel Output
EXCEL: tools | data analysis | ANOVA: single factor
SUMMARY
Groups Count Sum Average Variance
Club 1 5 1246 249.2 108.2
Club 2 5 1130 226 77.5
Club 3 5 1029 205.8 94.2
ANOVA
Source of
SS df MS F P-value F crit
Variation
Between
4716.4 2 2358.2 25.275 4.99E-05 3.89
Groups
Within
1119.6 12 93.3
Groups
Total 5836.0 14
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-81
The Tukey-Kramer Procedure
μ1= μ2 μ3 x
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-82
Tukey-Kramer Critical Range
MSW 1 1
Critical Range QU
2 n j n j'
where:
QU = Value from Studentized Range Distribution
with c and n - c degrees of freedom for
the desired level of a (see appendix E.8 table)
MSW = Mean Square Within
nj and nj’ = Sample sizes from groups j and j’
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-83
The Tukey-Kramer Procedure:
Example
1. Compute absolute mean
Club 1 Club 2 Club 3 differences:
254 234 200
263 218 222 x1 x 2 249.2 226.0 23.2
241 235 197 x1 x 3 249.2 205.8 43.4
237 227 206
251 216 204 x 2 x 3 226.0 205.8 20.2
QU 3.77
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-84
The Tukey-Kramer Procedure:
Example
(continued)
3. Compute Critical Range:
MSW 1 1 93.3 1 1
Critical Range QU 3.77 16.285
2 n j n j' 2 5 5
4. Compare:
5. All of the absolute mean differences
x1 x 2 23.2
are greater than critical range.
Therefore there is a significant x1 x 3 43.4
difference between each pair of
means at 5% level of significance. x 2 x 3 20.2
Thus, with 95% confidence we can conclude
that the mean distance for club 1 is greater
than club 2 and 3, and club 2 is greater than
club 3.
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-85
Chapter Summary
Compared two independent samples
Performed Z test for the difference in two means
Performed pooled variance t test for the difference in two
means
Performed separate-variance t test for difference in two means
Formed confidence intervals for the difference between two
means
Compared two related samples (paired
samples)
Performed paired sample Z and t tests for the mean difference
Formed confidence intervals for the mean difference
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-86
Chapter Summary
(continued)
Compared two population proportions
Formed confidence intervals for the difference between two population
proportions
Performed Z-test for two population proportions
Performed F tests for the difference between two
population variances
Used the F table to find F critical values
Described one-way analysis of variance
The logic of ANOVA
ANOVA assumptions
F test for difference in c means
The Tukey-Kramer procedure for multiple comparisons
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 10-87