Two-way ANOVA Example

Download Report

Transcript Two-way ANOVA Example

Analgesic study with three treatments crossed with gender.
Data on pain and factor levels
male
female
male
female
male
female
female
female
female
female
male
female
female
male
male
C
A
C
A
C
A
A
A
A
A
B
C
A
C
A
12.4
7.69
14.0
9.69
11.6
8.89
6.94
2.13
7.26
5.87
12.9
12.2
7.20
13.9
8.18
male
female
male
female
male
female
male
female
female
female
female
male
female
male
male
male
female
male
B
C
C
B
A
A
B
A
A
A
C
B
B
B
A
A
A
A
16.6
9.41
11.2
8.35
7.24
6.81
9.81
6.67
6.98
7.07
2.40
7.84
3.84
9.42
7.00
7.00
5.00
8.00
Factors and Response Variable
 Response variable, Y, is Pain index
 Gender is one factor (sometimes called independent
variable)
 Drug (type of analgesic agent) is the other factor
 All factor combinations are considered
Statistical Model
Yijk    Genderi  Drug j  Gender * Drugij   (ij )k
So that Pain level is modeled as a linear function of
Factor levels.
ANOVA table
Source
gender
drug
drug*gender
DF
1
2
2
Sum of Squares
73.8082
51.0591
30.5427
F Ratio
12.6378
4.3713
2.6148
Prob > F
0.0014*
0.0227*
0.0916
What if we had dropped the interaction from the
model since it was not significant?
The Drug Effect is now close to being not significant. Why?
Because we have inflated our MSE. In ANOVA, the model you
originally fit is generally the model you use for reporting significance.
Main Effect of Gender
Range Test on Main Effect of Drug
Level
Least Sq Mean
C
A
B
A
A
10.316622
B
8.710767
B
7.134856
Levels not connected by same letter are significantly
different.
Effect of Drug
What did Interaction term test?
The interaction tests whether an “Additive Model” is
adequate. The Additive model only contains Main
Effects and has the form:
Yijk    Gender i Drug j   (ij )k
Another way to think about Interaction is to look at
Interaction Plots.
Interaction plots
Alternate Interaction Plot
Residual Plot
Residual by Predicted
Normal Plot
Goodness of Fit
Goodness-of-Fit Test
Shapiro-Wilk W Test
W
0.970483
Prob<W
0.4936
Note: Ho = The data is from the Normal distribution. Small
p-values reject Ho.
Box-Cox Transformation
(lambda which minimizes SSE is optimal)