Following up on @jiltao 's comment - the code you present looks quite good for analyzing milk yield, but you may want to consider the following:
Parity is likely a fixed effect in this case, as the lactation curve is known to be different for heifers as compared to cows. Consider dichotomizing to two parity groups based on lactation number (primiparous = 1, multiparous >1) . Also, your code treats 'cow' as a subject, but is not included in the CLASS statement, so be sure that this variable is numeric and that the data are sorted by 'cow' and 'DIM'. Thus, you may wish to consider the following:
PROC GLIMMIX DATA = haytrial;
CLASS treatment DIM block parity;
MODEL milkyield=treatment*DIM*parity/DDFM=kr2;
RANDOM block;
RANDOM intercept/ SUBJECT=cow(block) group=parity;
RANDOM DIM/RESIDUAL SUBJECT=cow(block) TYPE=ar(1) group=parity;
LSMEANS parity*treatment*DIM;
RUN;
This enables you to fit different curves for the primiparous and multiparous animals, with different intercepts by parity and correlations in time by parity.
I don't see a reason to expect the use of a multinomial distribution unless you change to a different response variable, which would be categorical.
SteveDenham
... View more