Help using Base SAS procedures

Proc GLIMMIX

Reply
New Contributor
Posts: 2

Proc GLIMMIX

The following SAS code is from http://www.ats.ucla.edu/stat/sas/faq/anovmix1.htm

PROC MIXED DATA=long;
  CLASS sub group trial;
  MODEL dv = group trial group*trial;
  REPEATED trial / SUBJECT=sub TYPE=CS;
run;


I was just wondering how you would use PROC GLIMMIX to write this model. Would it be:

PROC GLIMMIX DATA =long;

  class sub group trial;

  MODEL dv = group;

  RANDOM trial/ SUBJECT = sub TYPE = CS;

  RANDOM trial sub trial*sub  trial*group;


Also out of curiosity, would the model be as follows:

DV =  GROUP + TRIAL + SUB + TRIAL*SUB + TRIAL*GROUP where the terms after GROUP are all random?

Valued Guide
Valued Guide
Posts: 684

Re: Proc GLIMMIX

No, your glimmix code is fitting a different model. Just take your MIXED code and change your REPEATED statement to:

RANDOM TRIAL / SUBJECT=SUB RESIDUAL TYPE=CS;

If you do not have missing values for trial (i.e., same trials for each subject), you can use:

RANDOM _RESIDUAL_ / SUBJECT=SUB TYPE=CS;

New Contributor
Posts: 2

Re: Proc GLIMMIX

What does the RESIDUAL option do?

Respected Advisor
Posts: 2,655

Re: Proc GLIMMIX

It sets up the R side matrix (repeated).

Steve Denham


Valued Guide
Valued Guide
Posts: 684

Re: Proc GLIMMIX

Posted in reply to SteveDenham

As Steve says, the statements in GLIMMIX

random _residual_ / sub=___ type=____;

or

random ___ / sub=____ type=____ RESIDUAL;

do the same thing as the REPEATED statement in MIXED. Since you had a model in MIXED that you wanted to fit in GLIMMIX, I showed you the appropriate code. 

Ask a Question
Discussion stats
  • 4 replies
  • 299 views
  • 2 likes
  • 3 in conversation