Stat 402A, HW 5 answers.
General Notes: I had lots of questions about these problems. Some of you tried to run my SAS
code with the new variable names. That didn’t give you what you needed, because the design of
these studies diFered from the design in my example. ±or example, in problem 2, both sources of
variability (lots and samples(lots)) are random. There is no ﬁxed eFect (other than the implicit
intercept). In general, the place to start if you have to do something like this again is to write out
the sources of variability (i.e. the terms in a model) then determine which are ﬁxed and which are
random.
Another common issue was to include sample(lot) in the random statement. If you write out
the model (or the sources of variation in the ANOVA table), you see that the ERROR term is
sample(lot). SAS includes an error by default. If you include sample(lot) in the random statement,
SAS tries to estimate both and can’t. The result is a residual variance that is almost zero (e.g.
1E6 or 1E12) and a residual d.f. that is 0.
±inally, a common problem was to forget the $ when reading variables with character (non
numeric) information. The input statement has to be tailored to the characteristics of the data to
be read. It will be diFerent for each data set.
1. Variability in hydrxoyl measurements
My code for all parts:
data hydroxy;
infile ’hydroxy.txt’;
input compound $ lab day y;
proc mixed method=type3;
class compound lab day;
model y = compound;
random lab(compound) day(lab*compound);
lsmeans compound;
run;
proc means mean stddev stderr;
/* se’s based on groupspecific sd */
class compound;
var y;
run;
proc glm;
/* se’s based on pooled sd */
class compound;
model y = compound;
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 Staff
 Variance, PROC GLM, variance components

Click to edit the document details