BookmarkSubscribeRSS Feed
zen_cool
Calcite | Level 5

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?

4 REPLIES 4
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

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;

zen_cool
Calcite | Level 5

What does the RESIDUAL option do?

SteveDenham
Jade | Level 19

It sets up the R side matrix (repeated).

Steve Denham


lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

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. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1022 views
  • 2 likes
  • 3 in conversation