BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
iatoloye
Fluorite | Level 6

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;

CODE 1.png

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;

CODE2.png

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!😊

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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.

View solution in original post

8 REPLIES 8
sbxkoenk
SAS Super FREQ

Hi,

 

I have moved your post to the "Statistical Procedures" board.

More chance to get a good answer here.

 

Good luck,

Koen

Rick_SAS
SAS Super FREQ

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.

iatoloye
Fluorite | Level 6
Thank you for the question. I forgot to mention that the treatments 0 and 50 were applied only once in the same year, say the year 2000, to different plots. So we have 3 blocks and one treatment with 2 levels (0 and 50) (6 plots in all) and data collected from the same 6 plots annually (2000 till 2020).
iatoloye
Fluorite | Level 6
I meant data collected biennially (2000 till 2020).
iatoloye
Fluorite | Level 6

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

Rick_SAS
SAS Super FREQ

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.

iatoloye
Fluorite | Level 6
Thank you for the link to the documentation. There is no obvious reason for using GLIMMIX.
SteveDenham
Jade | Level 19

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

SAS Innovate 2025: Register Now

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!

What is ANOVA?

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.

Discussion stats
  • 8 replies
  • 2033 views
  • 4 likes
  • 4 in conversation