Help using Base SAS procedures

Mixed to Glimmix

Reply
Occasional Contributor
Posts: 9

Mixed to Glimmix

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

Respected Advisor
Posts: 2,655

Re: Mixed to Glimmix

Posted in reply to elfkitty12

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

Ask a Question
Discussion stats
  • 1 reply
  • 166 views
  • 2 likes
  • 2 in conversation