Lab #11: Post-ANOVA Techniques
Due: Next Week (
Recall from last lab the statements required to perform an analysis of variance.
proc glm data = _____;
class group;
model response
= group;
run;
And if we wanted to test to determine if the residual were normal we included the following statement to output the data, and analyzed this new data set using proc plot and proc univariate.
output out=two p=yhat r=e ;
This gave us the data required to test two assumptions. First, we tested whether or not the residuals were normally distributed, which was accomplished using the univariate procedure. We could also check this graphically by using the residual plot. The residual plot also gives us an idea of whether or not the variances were equal over all levels of the class variable. The residual plot constructed last week indicated that this might not be the case. We can also include a statement in the glm procedure that will test this assumption for us.
means group / hovtest=
Another analysis we may be interested in is comparing the individual means for each level of the class variable. When you first perform an ANOVA you may often find that the class variable you are analyzing is found to be significant (p-value less than 0.05), indicating that the mean of at least one group differs from the others. This is important, but we often want to know which means differ from other means, and also may want to recommend a specific product (i.e resulting in the highest or lowest mean statistically different from the others). To do this you can use a means statement in proc glm. It is important to note that we cannot always use the means statement. When analyzing multiple factors (i.e. multiple classes) and unbalanced data we will use the lsmeans statement, which makes some adjustments. The means statement can once again be typed anywhere between the model statement and the run statement;
means group / lsd tukey bon
scheffe
This statement provides all pairwise comparisons, but we are often interested in comparing linear combinations of more than two means. To do this we use a contrast statement. For example, suppose we have four different levels of the variable group. SAS automatically assigns the levels in ascending order (i.e. suppose the levels were A B C D, then you would need to assign the coefficient for A first, followed by B etc.), and we must give a coefficient for each level. And suppose we wanted to test whether the mean of group one plus the mean of group two equal the mean of group four. Our statement would be as follows:
contrast 'Group 1 & 2 vs. Group 4' group 1 1 0 -2;
We can also get an estimate for the linear combination being tested as follows:
estimate 'Group 1 & 2 vs. Group 4' group 1 1 0 -2;
Assignment
Scientists were interested in examining the effect of glucose on the release of insulin. Twelve identical pancreas specimens were selected and randomly assigned one of three glucose treatments: Low, Med, and Hi. The amount of insulin released by the tissue was recorded. The data appear below:
Glucose
Conc.
Amount of Insulin Released
Low
1.59
Low
1.73
Low
3.64
Low
1.97
Med
3.36
Med
4.01
Med
3.49
Med
2.89
Hi
3.92
Hi
4.82
Hi
3.87
Hi
5.39
SAS Program
means Glucose / lsd tukey bon scheffe
means Glucose / hovtest=
contrast 'Glucose
Low & Med vs. Glucose Hi' glucose 1 1 -2;
estimate 'Glucose Low & Med vs. Glucose Hi' glucose 1 1 -2;
Questions