BookmarkSubscribeRSS Feed
elfkitty12
Calcite | Level 5

Hello!

I'm having some trouble with the glimmix procedure.

Basically, here is what I want to do: I want to take the following code that utilizes the mixed procedure, and write equivalent code that uses the glimmix procedure.  From what I understand, I can get both the mixed and glimmix procedures to produce (roughly) the same results.

My data is non-normal, which is why I need glimmix.  But I want a starting point to work off of.  I know the mixed procedure will run properly, so I want to make sure my glimmix code runs properly as well.

Here is my code for the mixed procedure

proc mixed data=sasuser.w_400_2012 method=reml;

class ID track_type;

model l_time = fixed_date track_type / s residual outp=work.resid;

random int fixed_date / subject=ID;

repeated / subject=ID type=SP(POW)(fixed_date);

lsmeans track_type / diff;

run;

quit;

If anyone can help me, that would be AWESOME.

And if you need more info, just let me know Smiley Happy

1 REPLY 1
SteveDenham
Jade | Level 19

Since GLIMMIX does not support the REPEATED statement as such, instead using _residual_ in a random statement, you might try:

proc mixed data=sasuser.w_400_2012 method=reml;

class ID track_type;

model l_time = fixed_date track_type / s residual outp=work.resid;

random int fixed_date / subject=ID;

random _residual_ / subject=ID type=SP(POW)(fixed_date);

lsmeans track_type / diff;

run;

Now when you shift over to a non-Gaussian distribution, take care, as most of the distributions are such that the means and variances are not independent, and perhaps should be modeled as G-side "repeated" rather than R-side "repeated".  See Walt Stroup's Generalized Linear Mixed Models (2013) for an interesting take on this.  A great book, with tons of GLIMMIX examples.

Steve Denham

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1432 views
  • 2 likes
  • 2 in conversation