Transcript Slide 1

Joyful mood is a meritorious deed
that cheers up people around you
like the showering of cool spring breeze.
Applied Statistics Using SAS
and SPSS
Topic: Two Way ANOVA
By Prof Kelly Fan, Cal State Univ, East Bay
Two Way ANOVA
Consider studying the impact of two factors on the
yield (response):
BRAND
1
2
DEVICE
3
4
1
17.9, 18.1
17.8, 17.8
18.1, 18.2
17.8, 17.9
2
18.0, 18.2
18.0, 18.3
18.4, 18.1
18.1, 18.5
3
18.0, 17.8
17.8, 18.0
18.1, 18.3
18.1, 17.9
NOTE:
The “1”,
“2”,etc...
mean
Level 1,
Level 2,
etc...,
NOT
metric
values
Here we have R = 3 rows (levels of the Row factor), C = 4
(levels of the column factor), and n = 2 replicates per cell
[nij for (i,j)th cell if not all equal]
Statistical model:
Yijk = ijijk
i = 1, ..., R
j = 1, ..., C
k= 1, ..., n
In general, n observations per cell, R • C cells.
1)
Ho: Level of row factor has no impact on Y
H1: Level of row factor does have impact on Y
2)
Ho: Level of column factor has no impact on Y
H1: Level of column factor does have impact on Y
3)
Ho: The impact of row factor on Y does not depend on column
H1: The impact of row factor on Y depends on column
1)
Ho: All Row Means i. Equal
H1: Not all Row Means Equal
2)
Ho: All Col. Means .j Equal
H1: Not All Col. Means Equal
3)
Ho: No Interaction between factors
H1: There is interaction between factors
INTERACTION
Two basic ways to look at interaction:
1)
AL
AH
BL
BH
5
10
8
?
If AHBH = 13, no interaction
If AHBH > 13, + interaction
If AHBH < 13, - interaction
- When B goes from BLBH, yield goes up by 3 (58).
- When A goes from AL AH, yield goes up by 5 (510).
- When both changes of level occur, does yield go up by
the sum, 3 + 5 = 8?
Interaction = degree of difference from sum of separate effects
BL
2)
AL
AH
5
10
BH
8
17
- Holding BL, what happens as A goes from AL AH? +5
- Holding BH, what happens as A goes from AL  AH? +9
If the effect of one factor (i.e., the impact of changing
its level) is DIFFERENT for different levels of another
factor, then INTERACTION exists between the two
factors.
NOTE:
- Holding AL, BL
- Holding AH, BL
BH has impact + 3
BH has impact + 7
(AB) = (BA) or (9-5) = (7-3).
ANOVA Table for Battery Lifetime
General Linear Model: time versus brand, device
Factor Type Levels Values
brand fixed
4 1, 2, 3, 4
device fixed
3 1, 2, 3
Analysis of Variance for time, using Adjusted SS for Tests
Source
brand
device
brand*device
Error
Total
DF
3
2
6
Seq SS
0.21000
0.28000
0.11000
12
23
Adj SS
0.21000
0.28000
0.11000
0.30000
0.90000
Adj MS F
0.07000 2.80
0.14000 5.60
0.01833 0.73
0.30000 0.02500
S = 0.158114 R-Sq = 66.67% R-Sq(adj) = 36.11%
P
0.085
0.019
0.633
Model Selection
Backward model selection:
1. Fit the full model: Y=A+B+A*B
2. Remove A*B if not significant; otherwise,
stop
3. Remove the most insignificant main effect
until all effects left are significant
Assumption checking for the final model
Brand Name Appeal for Men & Women:
M
F
Interesting Example:*
Frontiersman
50 people
per cell
April
Mean Scores
“Frontiersman”
Dependent
males
Variables
(n=50)
Intent-topurchase
4.44
“April”
males
(n=50)
“Frontiersman”
females
(n=50)
3.50
(*) Decision Sciences”, Vol. 9, p. 470, 1978
2.04
“April”
females
(n=50)
4.52
Interaction Plot - Data Means for y
brand
1
2
Mean
4
3
2
1
2
gender
Y 12
ANOVA Results
Dependent
Variable
Source
Intent-topurchase
(7 pt. scale)
Sex (A)
1
Brand name (B)
1
AxB
1
Error
196
*p<.05
**p<.01
***p<.001
d.f.
MS
23.80
29.64
146.21
4.24
F
5.61*
6.99**
34.48***
Exercise: Lifetime of a Special-purpose Battery
It is important in battery testing to consider
different temperatures and modes of use;
a battery that is superior at one temperature and mode of use is not necessarily
superior at other treatment combination.
The batteries were being tested at 4 different temperatures for three modes of use
(I for intermittent, C for continuous, S for
sporadic). Analyze the data.
Battery Lifetime (2 replicates)
Temperature
Mode of
use
1
2
3
4
I
12, 16
15, 19
31, 39
53, 55
C
15, 19
17, 17
30, 34
51, 49
S
11, 17
24, 22
33, 37
61, 67