Programming the statistical procedures from SAS

help with "estimate" statement in Proc glimmix

Reply
Occasional Contributor
Posts: 12

help with "estimate" statement in Proc glimmix

I am trying to build a linear mixed effect model assuming both random intercept and random slope. The data is like this: There are 3 groups (1 ,2 ,3) and 15 subjects in group 1, 8 subjects in group 2, 8 subjects in group 3. Each patient has been measured 3 times (time: 0, 1, 2). The outcome is continuous. so I assumed normal distribution and identity link function. 

I wrote code like this:

proc glimmix data=xxx;

class group time;

model outcome = group time group*time / dist=normal link=identity;

random intercept time / subject=id type=un;

estimate "group 1 - group 2 at time 0" ....................

               "group 1 - group 3 at time 0"....................

               "group 2 - group 3 at time 0".................../ adjust=t;

run;

After I ran the model, I found the interaction term "group*time" is significant. So I want to estimate the differences between groups at time 0 and adjust p-values by tukey. But I am not sure how to specify the values of fixed effect and random effect in the "estimate" statement. can anyone help with this?

In addition, if I specify time as linear instead of categorical variable, would it change the way how we specify the values of fixed effect and random effect?

Thanks.

Respected Advisor
Posts: 2,655

Re: help with "estimate" statement in Proc glimmix

I think you will want to approach this slightly differently.  Since your data are Gaussian, I would model the repeated nature of the design as an R side effect, rather than a G side.  This will make the "random" effect of time more easily handled in lsmeans.  I would use the LSMESTIMATE statement in GLIMMIX for the comparisons.  Thus, the code would look something like:

proc glimmix data=xxx;

class group time id;

model outcome = group time group*time / dist=normal link=identity;

random time /residual subject=id type=un;/*This fits an R side repeated structure*/

lsmestimate  group*time "group 1 - group 2 at time 0" 1 0 0  -1 0 0  0 0 0,

               "group 1 - group 3 at time 0" 1 0 0  0 0 0  -1 0 0,

               "group 2 - group 3 at time 0" 0 0 0  1 0 0  -1 0 0/ adjust=t elsm;/*The elsm option prints the K matrix.  Check it to make sure the comparisons I have here match your set-up */

run;

Of course, additional lsmestimate entries, or blocks, can be entered, depending on how you want to adjust your p values.

Steve Denham

Respected Advisor
Posts: 4,756

Re: help with "estimate" statement in Proc glimmix

Just a note. ADJUST=T is not shorthand for ADJUST=TUKEY. ADJUST=T calls for t-tests with no adjustment. ADJUST=TUKEY is not available for LSMeans differences. The choice of adjustment methods for LSMeans differences in GLIMMIX is quite limited.

PG
Valued Guide
Valued Guide
Posts: 684

Re: help with "estimate" statement in Proc glimmix

Actually, adjust=tukey is valid in GLIMMIX. There are many possible adjustments. Check the User's Guide.

SAS/STAT(R) 9.3 User's Guide

Valued Guide
Valued Guide
Posts: 684

Re: help with "estimate" statement in Proc glimmix

Oops. adjust=tukey IS available with the lsmeans statement (for pairwise differences). However, it is NOT available for estimate or lsmestimate statements. Sorry for confusion.

Respected Advisor
Posts: 2,655

Re: help with "estimate" statement in Proc glimmix

So, the answer (if someone really wants Tukey's adjustment) would be to use the STORE statement, and follow with PROC PLM, which has the full array of adjustment methods.

OTOH, perhaps using one of the available methods such as adjust=simulate would provide better coverage.

Steve Denham

Ask a Question
Discussion stats
  • 5 replies
  • 329 views
  • 1 like
  • 4 in conversation