Statistics for Managers Using Microsoft Excel, 4/e

Download Report

Transcript Statistics for Managers Using Microsoft Excel, 4/e

Analysis of Variance
Chap 10-1
Overview
Analysis of Variance (ANOVA)
One-Way
ANOVA
F-test
Two-Way
ANOVA
Interaction
Effects
TukeyKramer
test
Chap 10-2
General ANOVA Setting

Investigator controls one or more independent
variables



Observe effects on the dependent variable


Called factors (or treatment variables)
Each factor contains two or more levels (or groups or
categories/classifications)
Response to levels of independent variable
Experimental design: the plan used to collect
the data
Chap 10-3
Completely Randomized Design

Experimental units (subjects) are assigned
randomly to treatments


Only one factor or independent variable


Subjects are assumed homogeneous
With two or more treatment levels
Analyzed by one-factor analysis of variance
(one-way ANOVA)
Chap 10-4
One-Way Analysis of Variance

Evaluate the difference among the means of three
or more groups
Examples: Accident rates for 1st, 2nd, and 3rd shift
Expected mileage for five brands of tires

Assumptions
 Populations are normally distributed
 Populations have equal variances
 Samples are randomly and independently drawn
Chap 10-5
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)
H1 : Not all of the population means are the same

At least one population mean is different

i.e., there is a treatment effect

Does not mean that all population means are different
(some pairs may be the same)
Chap 10-6
One-Factor ANOVA
H0 : μ1  μ2  μ3    μc
H1 : Not all μi are the same
All Means are the same:
The Null Hypothesis is True
(No Treatment Effect)
μ1  μ2  μ3
Chap 10-7
One-Factor ANOVA
H0 : μ1  μ2  μ3    μc
(continued)
H1 : Not all μi 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
Chap 10-8
Partitioning the Variation

Total variation can be split into two parts:
SST = SSA + SSW
SST = Total Sum of Squares
(Total variation)
SSA = Sum of Squares Among Groups
(Among-group variation)
SSW = Sum of Squares Within Groups
(Within-group variation)
Chap 10-9
Partitioning the Variation
(continued)
SST = SSA + SSW
Total Variation = the aggregate dispersion of the individual
data values across the various factor levels (SST)
Among-Group Variation = dispersion between the factor
sample means (SSA)
Within-Group Variation = dispersion that exists among the
data values within a particular factor level (SSW)
Chap 10-10
Partition of Total Variation
Total Variation (SST)
=




Variation Due to
Factor (SSA)
Commonly referred to as:
Sum of Squares Between
Sum of Squares Among
Sum of Squares Explained
Among Groups Variation
Variation Due to Random
Sampling (SSW)
+




Commonly referred to as:
Sum of Squares Within
Sum of Squares Error
Sum of Squares Unexplained
Within Groups Variation
Chap 10-11
Total Sum of Squares
SST = SSA + SSW
c
nj
SST   ( Xij  X)
2
Where:
j1 i1
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)
Chap 10-12
Total Variation
(continued)
SST  ( X11  X)2  ( X12  X)2  ...  ( Xcnc  X)2
Response, X
X
Group 1
Group 2
Group 3
Chap 10-13
Among-Group Variation
SST = SSA + SSW
c
SSA   n j ( X j  X)
2
Where:
j1
SSA = Sum of squares among groups
c = number of groups or populations
nj = sample size from group j
Xj = sample mean from group j
X = grand mean (mean of all data values)
Chap 10-14
Among-Group Variation
(continued)
c
SSA   n j ( X j  X)
2
j1
Variation Due to
Differences Among Groups
SSA
MSA 
k 1
Mean Square Among =
SSA/degrees of freedom
i
j
Chap 10-15
Among-Group Variation
(continued)
SSA  n1(x1  x)  n2 (x2  x)  ...  nc (xc  x)
2
2
2
Response, X
X3
X1
Group 1
Group 2
X2
X
Group 3
Chap 10-16
Within-Group Variation
SST = SSA + SSW
c
SSW  
j1
nj

i1
( Xij  X j )
2
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
Chap 10-17
Within-Group Variation
(continued)
c
SSW  
j1
nj

i1
( Xij  X j )2
Summing the variation
within each group and then
adding over all groups
SSW
MSW 
nc
Mean Square Within =
SSW/degrees of freedom
i
Chap 10-18
Within-Group Variation
(continued)
SSW  ( x11  X1 )  ( X12  X2 )  ...  ( Xcnc  Xc )
2
2
2
Response, X
X3
X1
Group 1
Group 2
X2
Group 3
Chap 10-19
Obtaining the Mean Squares
SSA
MSA 
c 1
SSW
MSW 
nc
SST
MST 
n 1
Chap 10-20
One-Way ANOVA Table
Source of
Variation
SS
df
Among
Groups
SSA
c-1
Within
Groups
SSW
n-c
SST =
SSA+SSW
n-1
Total
MS
(Variance)
F ratio
SSA
MSA
MSA =
c - 1 F = MSW
SSW
MSW =
n-c
c = number of groups
n = sum of the sample sizes from all groups
df = degrees of freedom
Chap 10-21
One-Factor ANOVA
F Test Statistic
H0: μ1= μ2 = … = μc
H1: At least two population means are different

Test statistic
MSA
F
MSW
MSA is mean squares among variances
MSW is mean squares within variances

Degrees of freedom


df1 = c – 1
df2 = n – c
(c = number of groups)
(n = sum of sample sizes from all populations)
Chap 10-22
Interpreting One-Factor 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,
otherwise do not
reject H0
 = .05
0
Do not
reject H0
Reject H0
FU
Chap 10-23
One-Factor ANOVA
F Test Example
You want to see if three
different golf clubs yield
different distances. You
randomly select five
measurements from trials on
an automated driving
machine for each club. At the
.05 significance level, is there
a difference in mean
distance?
Club 1
254
263
241
237
251
Club 2
234
218
235
227
216
Club 3
200
222
197
206
204
Chap 10-24
One-Factor ANOVA Example:
Scatter Diagram
Club 1
254
263
241
237
251
Club 2
234
218
235
227
216
Club 3
200
222
197
206
204
Distance
270
260
250
240
•
••
•
•
230
220
X1
••
•
••
X2
210
x1  249.2 x 2  226.0 x 3  205.8
200
x  227.0
190
•
••
••
1
2
Club
X
X3
3
Chap 10-25
One-Factor ANOVA Example
Computations
Club 1
254
263
241
237
251
Club 2
234
218
235
227
216
Club 3
200
222
197
206
204
X1 = 249.2
n1 = 5
X2 = 226.0
n2 = 5
X3 = 205.8
n3 = 5
X = 227.0
n = 15
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
MSA = 4716.4 / (3-1) = 2358.2
MSW = 1119.6 / (15-3) = 93.3
2358.2
F
 25.275
93.3
Chap 10-26
One-Factor ANOVA Example
Solution
H0: μ1 = μ2 = μ3
H1: μi not all equal
 = .05
df1= 2
df2 = 12
Critical
Value:
FU = 3.89
 = .05
0
Do not
reject H0
Reject H0
FU = 3.89
Test Statistic:
MSA 2358.2
F

 25.275
MSW
93.3
Decision:
Reject H0 at  = 0.05
Conclusion:
There is evidence that
at least one μi differs
F = 25.275
from the rest
Chap 10-27
ANOVA -- Single Factor:
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
Variation
SS
df
MS
Between
Groups
4716.4
2
2358.2
Within
Groups
1119.6
12
93.3
Total
5836.0
14
F
25.275
P-value
4.99E-05
F crit
3.89
Chap 10-28
The Tukey-Kramer Procedure

Tells which population means are significantly
different



e.g.: μ1 = μ2  μ3
Done after rejection of equal means in ANOVA
Allows pair-wise comparisons

Compare absolute mean differences with critical
range
μ1= μ2
μ3
x
Chap 10-29
Tukey-Kramer Critical Range
Critical Range  QU
MSW
2
1 1
  
n n 
j' 
 j
where:
QU = Value from Studentized Range Distribution
with c and n - c degrees of freedom for
the desired level of  (see appendix E.9 table)
MSW = Mean Square Within
ni and nj = Sample sizes from groups j and j’
Chap 10-30
The Tukey-Kramer Procedure:
Example
Club 1
254
263
241
237
251
Club 2
234
218
235
227
216
Club 3
200
222
197
206
204
1. Compute absolute mean
differences:
x1  x 2  249.2  226.0  23.2
x1  x 3  249.2  205.8  43.4
x 2  x 3  226.0  205.8  20.2
2. Find the QU value from the table in appendix E.9 with
c = 3 and (n – c) = (15 – 3) = 12 degrees of freedom
for the desired level of  ( = .05 used here):
QU  3.77
Chap 10-31
The Tukey-Kramer Procedure:
Example
(continued)
3. Compute Critical Range:
Critical Range  QU
MSW
2
1 1
    3.77 93.3  1  1   16.285
n n 
2 5 5
j' 
 j
4. Compare:
5. All of the absolute mean differences
are greater than critical range.
Therefore there is a significant
difference between each pair of
means at 5% level of significance.
x1  x 2  23.2
x1  x 3  43.4
x 2  x 3  20.2
Chap 10-32
Two-Way ANOVA

Examines the effect of

Two factors of interest on the dependent
variable


e.g., Percent carbonation and line speed on soft drink
bottling process
Interaction between the different levels of these
two factors

e.g., Does the effect of one particular carbonation
level depend on which level the line speed is set?
Chap 10-33
Two-Way ANOVA
(continued)

Assumptions

Populations are normally distributed

Populations have equal variances

Independent random samples are
drawn
Chap 10-34
Two-Way ANOVA
Sources of Variation
Two Factors of interest: A and B
r = number of levels of factor A
c = number of levels of factor B
n’ = number of replications for each cell
n = total number of observations in all cells
(n = rcn’)
Xijk = value of the kth observation of level i of
factor A and level j of factor B
Chap 10-35
Two-Way ANOVA
Sources of Variation
SST = SSA + SSB + SSAB + SSE
SSA
Factor A Variation
SST
Total Variation
SSB
Factor B Variation
SSAB
n-1
(continued)
Degrees of
Freedom:
r–1
c–1
Variation due to interaction
between A and B
(r – 1)(c – 1)
SSE
rc(n’ – 1)
Random variation (Error)
Chap 10-36
Two Factor ANOVA Equations
Total Variation:
r
n
c
SST   ( Xijk  X)
2
i1 j1 k 1
Factor A Variation:
r
2

SSA  cn  ( Xi..  X)
i1
Factor B Variation:
c
2

SSB  rn  ( X. j.  X)
j1
Chap 10-37
Two Factor ANOVA Equations
(continued)
Interaction Variation:
r
c
SSAB  n ( Xij.  Xi..  X. j.  X)2
i1 j1
Sum of Squares Error:
r
c
n
SSE   ( Xijk  Xij. )2
i1 j1 k 1
Chap 10-38
Two Factor ANOVA Equations
r
where:
X
Xi.. 
 X
j1 k 1
i1 j1 k 1
rcn
 Grand Mean
 Mean of ith level of factor A (i  1, 2, ..., r)
r
n
ijk
ijk
cn
X. j. 
(continued)
n
 X
n
c
c
n
 X
i 1 k 1
rn
ijk
 Mean of jth level of factor B (j  1, 2, ..., c)
Xijk
Xij.  
 Mean of cell ij
k 1 n
r = number of levels of factor A
c = number of levels of factor B
n’ = number of replications in each cell
Chap 10-39
Mean Square Calculations
SSA
MSA  Mean square factor A 
r 1
SSB
MSB  Mean square factor B 
c 1
SSAB
MSAB  Mean square interaction 
(r  1)(c  1)
SSE
MSE  Mean square error 
rc(n'1)
Chap 10-40
Two-Way ANOVA:
The F Test Statistic
H0: μ1.. = μ2.. = μ3.. = • • •
H1: Not all μi.. are equal
H0: μ.1. = μ.2. = μ.3. = • • •
H1: Not all μ.j. are equal
H0: the interaction of A and B is
equal to zero
H1: interaction of A and B is not
zero
F Test for Factor A Effect
MSA
F
MSE
Reject H0
if F > FU
F Test for Factor B Effect
MSB
F
MSE
Reject H0
if F > FU
F Test for Interaction Effect
MSAB
F
MSE
Reject H0
if F > FU
Chap 10-41
Two-Way ANOVA
Summary Table
Source of
Variation
Sum of
Squares
Degrees of
Freedom
Mean
Squares
F
Statistic
Factor A
SSA
r–1
MSA
MSA
MSE
Factor B
SSB
c–1
AB
(Interaction)
SSAB
(r – 1)(c – 1)
Error
SSE
rc(n’ – 1)
Total
SST
n–1
= SSA /(r – 1)
MSB
= SSB /(c – 1)
MSAB
= SSAB / (r – 1)(c – 1)
MSB
MSE
MSAB
MSE
MSE =
SSE/rc(n’ – 1)
Chap 10-42
Features of Two-Way ANOVA
F Test

Degrees of freedom always add up

n-1 = rc(n’-1) + (r-1) + (c-1) + (r-1)(c-1)

Total = error + factor A + factor B + interaction

The denominator of the F Test is always the
same but the numerator is different

The sums of squares always add up

SST = SSE + SSA + SSB + SSAB

Total = error + factor A + factor B + interaction
Chap 10-43
Examples:
Interaction vs. No Interaction
No interaction:
Interaction is
present:
Factor B Level 3
Factor B Level 2
Factor A Levels
Mean Response
Factor B Level 1
Mean Response


Factor B Level 1
Factor B Level 2
Factor B Level 3
Factor A Levels
Chap 10-44