05-24-2017 09:27 PM
I would like to have my SAS statement checked (mainly the random error). I have a randomized complete block design; lambs were separated by gender (not a trt, just used equal # of males/females per trt) and then stratified by BW within gender (trt assignments below; data collected over multiple days).
I'm not sure when to use sex*wtblock vs. sex wtblock separately.
Or, do I put sex wtblock in model statement?
CLASS TRT DAY ID sex wtblock;
MODEL BWkg = TRT|DAY/DDFM=KR SOLUTION;
REPEATED DAY/SUBJECT=ID TYPE = UN;
random sex wtblock;
LSMEANS TRT|DAY/DIFF ADJUST=SIMULATE (REPORT SEED=121211) cl adjdfe=row SLICE=(DAY TRT);
05-26-2017 12:07 AM
1. Sex is not a random effects factor; it is fixed. I recommend
for its articulation of what is fixed, what is random, and what is hard to decide.
2. For similar studies in the future, I would ponder a different design with respect to allocation of animals of different weights to treatments. Blocking is very crude (you lose all that information about individual weights by lumping five animals into the same group), and you are measuring weights anyway, so think about using initial weight as a covariate. Even better, consult with a statistician at your institution/company (if one is available) about design possibilities.
3. I recommend not applying Type I error adjustment within the LSMEANS statement to pairwise differences among interaction means, because many of the comparisons are not sensible (e.g., A1B1 to A2B3). You lose too much power that way. Pairwise comparisons among main effects means are fine.
4. Assuming that I understand your design correctly, I would consider
proc mixed data=have; class wtblock sex trt day; model bwkg = sex | trt | day; random wtblock(sex); repeated day / subject= trt*wtblock(sex) type=<whatever>; run;
where <whatever> is CS or AR(1) or such, but not UN: your sample size is most likely too small to support all the covariance estimates (depending upon the number of DAYs). Along with the MIXED documentation on covariance structure types, I recommend
To implement the AR(1)+RE structure described in the above paper, you would include
Few other covariance structures include that term.