Lab 12: More ANOVA
Due: Next Week (November 18, 2003)
This week's lab is a review of the ANOVA techniques that we
have covered so far with one exception. As mentioned last lab we are often
interested in comparing the means of the different groups, and we used the means
statement with various adjustments (lsd tukey etc.) to do this. We
can also use the lsmeans statement.
lsmeans _____ /
stderr pdiff adjust = tukey;
- In simple cases the lsmeans
statement will give the same results as the means statement.
- The stderr option
produces the standard error of the lsmeans as well as the test of each
lsmean = 0.
- The pdiff option gives
p-value for the difference between each pair of means. This p-value
is interpreted similarly to those we have used before. If the
p-value is less than 0.05, then we can conclude that the two means are
different, otherwise the two means are not different. The output
from this option is a table of p-values for all pairwise comparisons of
means.
- PAY SPECIAL ATTENTION to the
lsmean number assigned to each mean. It is the lsmean number that is
used in the pairwise comparison table, and not the raw values of the class
variable.
- The adjust option
specifies the type of adjustment SAS uses for making multiple comparisons,
which is similar to what was done with the means statement last
week, except that different types of adjustments are available. Look
at the LSMEANS topic under SAS help for more information.
- The lsmeans statement
is very useful, since it can make adjustments for additional factors that
may be in the model.
Assignment
Given below are data from a study to examine the effect of added dietary
molybdenum (ADDEDMO) on the molybdenum concentration in sheep kidneys
(KIDNEYMO). Scientists wanted to determine whether different
concentrations of added molybdenum would result in different concentrations of
molybdenum in the kidney. NOTE: This is the first time we will be
using a numeric variable (ADDEDMO) as the class variable.
ADDED
MO KIDNEY MO
0
2.8126
0
3.2084
0
3.5771
0
3.4228
0
4.0606
15
4.5645
15
2.7061
15
4.3560
15
3.3012
15
5.1091
30
4.4732
30
8.6097
30
4.9598
30
4.8945
30
3.6786
45
7.7524
45
5.9198
45
9.1892
45
9.7367
45
15.7416
SAS Program
- Input the data.
- Conduct an analysis to
determine whether the amount of molybdenum in the kidney differs for each
level of added molybdenum.
proc glm data = one;
class ADDEDMO ;
model KIDNEYMO = ADDEDMO ;
- Include a statement to test for
homogeneity of variances using Bartlett's test.
means ADDEDMO / hovtest=bartlett;
- Using the lsmeans
statement conduct all pairwise comparisons. Include all the options
discussed in the example given above.
lsmeans ADDEDMO / stderr pdiff adjust = tukey;
output out = two p =
yhat r = e; run;
- Construct a residual plot.
proc plot data = two;
plot e*yhat/vref=0; run;
- Test for normality of the
residuals.
proc univariate data = two normal plot;
var e;
run;
quit;
Questions
- Are the variances
homogenous? Include the p-value from your output.
- Are there any problems with
the residual plot? If so comment on any problems that you see.
- Are the residuals normally
distributed? Include the p-value from your output.
- Based on your answers to the
first three questions tell me if it would be appropriate to further
examine the results. Why or why not?
- REGARDLESS of any problems
that may exist test whether or not kidney molybdenum concentration is the
same for all levels of added molybdenum (i.e. use the normal
F-test). Include the p-value from your output.
- IF kidney molybdenum
concentration is NOT the same for all levels of added molybdenum examine
the results from the lsmeans statement. Report the pair(s) of
means that ARE significantly different, and include their respective
p-values.