As I look over the output, I see that you have 83 observations, coded as VID, but not sequentially, based on the PROC PRINT. I am going to assume that GROUP is some sort of pen/pasture grouping of animals that have all of the 8 possible combinations of sex, frame and supplement level represented. The key here is that YEAR and PERIOD are completely confounded, per @mkeintz 's comment--if an observation has PERIOD = 1 or 2, it must have YEAR = 1, and if PERIOD is in 3, 4,or 5, then the record must have YEAR=2.
So you need to remove YEAR from the MODEL. We will get back to how to test for a year effect after we go through the other factors. Sex, Sire, Period and Trmt are all fixed effects, with GROUP a random effect. That means that we will need to get creative outside the MODEL and RANDOM statement. First, let's look at how to model Period as a REPEATED effect. With only 2 or 3 levels per year, I would try the following structure for the covariance matrix. First, the covariance between periods in different years should be fixed at zero. Next, the number of parameters for YEAR=1 is 3 (2 variances, 1 covariance) and for YEAR=2 is 6 (3 variances, 3 covariances). If I fit something like that I would use the PARMS statement with a HOLD option. So, before we do LSMEANs and SLICES, the code I am suggesting would look like:
PROC MIXED;
Class Group Sire Sex TRMT Period VID;
Model kgPERdayForageDMI=Sire Sex TRMT|Period;
random Group;
REPEATED/type= UN r rcorr subject=VID(period);
PARMS (.) (.) (.) 0 0 (.) 0 0 (.) (.) 0 0 (.) (.) (.) /hold=3,4,6,7,10,11;
RUN;
If that runs without errors or warnings, then the following code can be inserted:
lsmeans TRMT TRMT*Period/pdiff=ALL adjust=TUKEY;
SLICE TRMT*Period/SLICEBY=period diff adjust=TUKEY;
LSMESTIMATE period 'Year 1 averaged over TRMT' 1 1 0 0 0 divisor=2,
'Year 2 averaged over TRMT' 0 0 1 1 1 divisor=3,
'Year 1 minus Year 2, =Year effect' 3 3 -2 -2 -2 divisor=6;
The LSMESTIMATE statement calculates the year 1 mean, year 2 mean and the difference, which tests the null hypothesis that the Year means are equal, holding all other parameters at their mean values.
SteveDenham
... View more