Module 14: Two-Way ANOVA 1 Two-way ANOVA Assignment: 14.2, 14.8

advertisement
Module 14: Two-Way ANOVA
Assignment: 14.2, 14.8
February 20, 2008
1
Two-way ANOVA
In two-way ANOVA, we have the following model
y = β0 + β1 A + β2 B + β3 AB + A and B are the factors and AB is the interaction term. The residual, , are assumed to
be independent and normally distributed with mean = 0 and variance = σ 2 . There are
certain ways to check for these assumptions using SAS. These tests are :
1. We can plot the residual vs. the main effects or the residual vs. the estimated value
of y. The width of the scatter plot should be the same if the variance is constant.
2. We can look at a normal probability plot to see if the residuals are normally distributed.
Example 14.1 In an experiment designed to compare the Hybrid III dummy to humans,
two tyoes of impactors (bar and disc) were used to fracture the skull. The response variable is stiffness. Is the average stiffness of dummies and humans different? Is the average
stiffness for type of impactor different? We should first check the model assumptions
before we proceed with any kind of analysis.
filename datain ’Dummy.dat’;
data one;
infile datain;
input species $ impactor $ stiff1 stiff2 calcium magnesium;
run;
proc glm data=one;
class species impactor;
model stiff1 = species impactor species*impactor;
output out=new p=yhat r=resid;
run;
1
proc plot data=new;
plot resid*yhat;
plot resid*species;
plot resid*impactor;
run;
proc univariate normal plot data=new;
var resid;
run;
If we look at the output, the plot of the residuals vs. y-hat indicates there is likely nonconstant variance. The plot of the residuals vs. the main effects ( species and impactor)
indicate the same thing. The p-value for testing whether the data is normal is 0.3499. This
and the normal probability plot indicate that the normality assumption is not violated.
2
Download