Hello All,
I am uncertain which of the statements I have for the random statement in my code is correct. I have a data set collected annually from the same set of plots and one treatment factor (with two levels) and three blocks. I am trying to determine the differences between the treatment levels using repeated measures.
Sample data
Treatment Block Year Yield @@;
0 1 2008 50
50 1 2008 75
0 2 2008 65
50 2 2008 85
0 1 2010 45
50 1 2010 65
...
Below are the codes:
First code:
proc glimmix data = Hist plots = studentpanel;
class block treatment Year ;
model lScore_Mean = treatment|year ;
random block block*treatment;
run;
Second code:
proc glimmix data = Hist.SHAPE plots=residualpanel;
class block treatment Year ;
model lScore_Mean = treatment|year / ddfm=kr2;
random intercept / subject=block ;
random year / residual subject=block*treatment;
covtest 'Is GLM OK?' glm;
run;
The results of the first code showed the treatment effect was not significant (p>0.1) while the results of the second code showed the treatment effect was significant (p<0.1).
I was hoping to get similar results but it seems I am not clear about the denominator degrees of freedom. I got different answers and I am not sure which one is right.
Thank you very much!😊
This is a linear mixed model. Is there a reason you want to use GLIMMIX instead of PROC MIXED?
The documentation for PROC MIXED contains examples of block designs and repeated measures.
Hi,
I have moved your post to the "Statistical Procedures" board.
More chance to get a good answer here.
Good luck,
Koen
Can you clarify your experiment? The data seem to say that each block received Treatment=0 and Treatment=50 in the same year? Is that correct? I don't understand how the block can get both treatments at the same time.
I have reposted the sample data
Treatment Block Year Yield @@;
0 1 2008 50
50 1 2008 75
0 2 2008 65
50 2 2008 85
0 3 2008 65
50 3 2008 85
0 1 2010 45
50 1 2010 65
0 2 2010 65
50 2 2010 85
0 3 2010 65
50 3 2010 85
This is a linear mixed model. Is there a reason you want to use GLIMMIX instead of PROC MIXED?
The documentation for PROC MIXED contains examples of block designs and repeated measures.
You will find that GLIMMIX does some rather unusual things with denominator degrees of freedom, at least in my opinion (see the documentation - Details>Degrees of Freedom Methods for a full discussion). Check the output - in the Model Information table, it will indicate which method is used. That is most likely the source of the difference you are seeing.
SteveDenham
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.