Homework #3 STAT 506 Spring 2013
Due date: January 25, 2013
Again, we'll redo exercises from last semester, this time using
SAS.
Write up answers as a report including all SAS code as an appendix.
SAS output could appear in your report near where you refer to it, or
in the appendix if it's not terribly relevant, or not at all, if you
think SAS should not have bothered to print it.
- Use these data. The
experimental units are 12 thirsty albino rats who are trained to press a
lever to get water prior to the experiment. Their pre-experiment
pressing rate is recorded as low (1), medium (2), or high (3). They
are then injected with one of four levels of a drug where 0 is a
control saline solution, the other values are mg per kg of the rat's
weight. This was a cross-over design replicated twice, so each rat
has 8 measurements of postRate (number of lever presses per
second), two at each of four drug levels, and the order of
treatments was randomized for each rat. Time intervals between
treatments were long enough to remove any carryover effects.
- Begin with appropriate plot(s) to examine how postRate
changes with the two factors. Describe what you see.
- Write out a model for these data using preRate as a
three-level factor and drug as a four-level factor. Include
distributions for all random components (assuming normality
throughout).
- Omit This part Fit the above model to the data using
PROC GLM in
SAS using a repeated statement for ratID. Explain the results.
- Fit the above model to the data using
PROC MIXED in
SAS using a random term for each rat. Explain results and
compare to those just above.
- Compare results with those we got last semester in HW5 using R.
- Load the Sitka data (from the MASS library in R) on
the growth of 79 sitka spruce trees.
- Either include a nice R plot from last semester, or build
a similar plot in SAS. Discuss the relationship between time
and volume.
- Use
PROC GLM to fit a quadratic model across
all the data. Update the model adding treatment effects which
allow the intercept, slope, or quadratic coefficients to
depend on treatment.
- Using
PROC MIXED
- Add AR1 correlation structure (within a tree).
- Add compound symmetric correlation (within a tree).
- Add symmetric correlation (within a tree).
Compare the four models using AIC.
- Reduce the model one term at a time until all terms
have small p-values in the t-tests.
- Plot the residuals versus fitted and normal quantile
plots. Discuss any problems.
- How does the ozone treatment affect growth of these trees?
Does SAS give results just like those of R?
- In a study of soil properties, samples were taken on a 10
point by 25 point
grid. Download the data here We'll work with two variables: response Ca
(calcium concentration) and predictor pH (low numbers are acidic, high
numbers basic, 7 is neither).
- Make a scatterplot of the two variables and fit a model for
Ca based on pH. (Choose the form of the model based on the
scatterplot.) Print the estimated coefficients and discuss the
relationship.
- Fit the five forms of spatial correlation available in the
nlme library. Correction: I haven't found rational
quadratic in SAS. You can skip it. Compare them with each
other and with the
original model. Do any of the spatial correlation fits improve
AIC by more than 2 units? Which is the best of the 5 fits?
BTW, one way to get AIC is to run the original (no correlation)
model in Proc Mixed.
- Compare results with those we got last semester in HW6 using R.
Author:
Jim Robison-Cox
Last Updated: