Programming the statistical procedures from SAS

GLIMMIX for repeated measures

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

GLIMMIX for repeated measures

I'm currently struggling with the implementation of a generalized linear mixed effects model in SAS using PROC GLIMMIX,

and would like to ask for some support:

My endpoint variable is a response repeatedly measured (once per week) for each subject of different treatment groups.

I would like to fit a GLMM with binomial distribution, logit link function, random intercept and fixed terms of treatment group, week and treatment by week interaction
interaction as explanatory variables, using the subjects’ by-week responder
status as the response variable.

The  main issue is to fit the model so that a subject-specific random intercept is assumed and the repeated structure of the data is considered.

After extended exploration of GLIMMIX, I ended up with the following solution, but I'm not sure if that really reflects the analysis appropriately:

PROC GLIMMIX DATA = resp;

CLASS subject_id treatment week;

MODEL response = treatment week treatment*week /DIST=binomial LINK=logit OR SOLUTION;

RANDOM week /SUBJECT=subject_id TYPE=un RESIDUAL;

RUN;

According to PROC GLIMMIX documentation, this should reflect the repeated structure of the data appropriately, but we are not convinced, if this also correctly reflects the random intercept.

For PROC MIXED I know that it’s sufficient in such a situation to have the REPEATED statement specified, and that no additional RANDOM statement is needed.

Does that also hold here for PROC GLIMMIX?

Does the proposed code what I want to do?

I also tried the following, to have the random intercept and repeated included:

RANDOM intercept/ SUBJECT=subject_id;

RANDOM week / SUBJECT=subject_id TYPE=un RESIDUAL;

….

but here problems with convergency of the model (also independent of the TYPE used) occurred, and I do not know if this is a real “no convergence” due to observed data
constellation, or if the problem of non-convergence comes from an incorrect model specifications.

Thanks a lot for any support


Accepted Solutions
Solution
‎04-16-2015 01:06 PM
Respected Advisor
Posts: 2,655

Re: GLIMMIX for repeated measures

I'll work from the bottom up.

Regarding convergence--it appears that you do not have an NLOPTIONS statement in your code, so it is quite possible that you are getting the "no convergence" message when the 20th iteration rolls around.  Unless you specify MAXITER= <insert value> in an NLOPTIONS statement, GLIMMIX will terminate at the 20th iteration.

Now, the combination random/residual code:  This approach makes sense if the residual code does not accommodate a separate subject effect.  For instance, covariance structures that build in a correlation, such as AR(1), ANTE(1,1), SP(POW)(x) and a lot of others do not accommodate subject to subject variability, hence the use of the random intercept term when fitting these often results in superior performance (see Littell et al. J. Anim. Sci. 1998. 76:1216–1231).  However, for certain structures, and UN is one of them, the random intercept term is redundant, and leads to poorer performance.

So, in the end, I think your code is perfectly reasonable for a marginal model.  If you wish to make it conditional, add method=laplace to the PROC statement, and remove RESIDUAL from the RANDOM statement.  What you have though should certainly be adequate.

Steve Denham

View solution in original post


All Replies
Solution
‎04-16-2015 01:06 PM
Respected Advisor
Posts: 2,655

Re: GLIMMIX for repeated measures

I'll work from the bottom up.

Regarding convergence--it appears that you do not have an NLOPTIONS statement in your code, so it is quite possible that you are getting the "no convergence" message when the 20th iteration rolls around.  Unless you specify MAXITER= <insert value> in an NLOPTIONS statement, GLIMMIX will terminate at the 20th iteration.

Now, the combination random/residual code:  This approach makes sense if the residual code does not accommodate a separate subject effect.  For instance, covariance structures that build in a correlation, such as AR(1), ANTE(1,1), SP(POW)(x) and a lot of others do not accommodate subject to subject variability, hence the use of the random intercept term when fitting these often results in superior performance (see Littell et al. J. Anim. Sci. 1998. 76:1216–1231).  However, for certain structures, and UN is one of them, the random intercept term is redundant, and leads to poorer performance.

So, in the end, I think your code is perfectly reasonable for a marginal model.  If you wish to make it conditional, add method=laplace to the PROC statement, and remove RESIDUAL from the RANDOM statement.  What you have though should certainly be adequate.

Steve Denham

New Contributor
Posts: 2

Re: GLIMMIX for repeated measures

Thanks a lot for the explanations and your help!

Occasional Contributor
Posts: 9

Re: GLIMMIX for repeated measures

This is a very helpful thread.  My study question is similar.

I am comparing two machines (FLACS) for helping people achieve better vision (mae_25).

Each patient (DOBID) has 2 eyes (left), and has two measurements separated in time (fu).

I want to know the effect of FLACS on mae_25 for each fu time.

Here is my current model:

proc glimmix method=laplace ;
class DOBID left flacs fu;

model mae_25 (ref='1') = flacs fu flacs*fu left/dist=bin link=logit cl oddsratio;

random int / subject=DOBID;

lsmeans flacs/cl ilink;
lsmeans flacs*fu/slicediff=fu cl ilink;
lsmeans fu/cl ilink

Thoughts on using "random _residual_ / subject=DOBID" instead of method=leplace?

Any opinion on correlation structure?

Should I have a random statement for eye (left)?

Should I be nesting the structure?  If so, how can I get probabilities for flacs and fu for giving mae_25?

Thks in advance for any help.

Respected Advisor
Posts: 2,655

Re: GLIMMIX for repeated measures

As it stands now, you are treating the measurements from each eye as independent measures.If you believe they are correlated, then it would make sense to try this:

proc glimmix method=laplace ;
class DOBID left flacs fu left;

model mae_25 (ref='1') = flacs fu flacs*fu left/dist=bin link=logit cl oddsratio;

random int / subject=DOBID;

random left/type=un subject=DOBID; /* In this conditional approach, it is how I would model eye to eye variability within subject */

lsmeans flacs/cl ilink;
lsmeans flacs*fu/slicediff=fu cl ilink;
lsmeans fu/cl ilink;

run;

Now, a marginal approach may make more sense here, in that the measures on the eyes apply only to two levels (I doubt strongly that any multi-optic subjects were enrolled).  In this case, you have two repeated factors. In PROC MIXED there are specific doubly repeated structures to address this, while GLIMMIX doesn't have those.  One way to get at this would be to try:

proc glimmix ;
class DOBID left flacs fu;

model mae_25 (ref='1') = flacs fu flacs*fu left/dist=bin link=logit cl oddsratio;

random int / subject=DOBID;

random fu/residual subject=left(DOBID) type=ar(1);  /* You'll need to choose the covariance type based on the spacing of the follow-up times, with ar(1) being appropriate for equally spaced time points */

random left/type=un subject=DOBID;

lsmeans flacs/cl ilink;
lsmeans flacs*fu/slicediff=fu cl ilink;
lsmeans fu/cl ilink;

run;

Good luck.

Steve Denham

Occasional Contributor
Posts: 9

Re: GLIMMIX for repeated measures

Thanks Steve!!

Additional clarification:

Yes, I suspect the patient's two eyes will be correlated, and that their measurement at each fu will be correlated.  The measurement (mae_25) only occurs once at each fu. I doubt left eyes across patients and right eyes across patients will be correlated.

The fu interval is 3 weeks and then 8 weeks, so not equal.

Mae_25 is binary, though I will also be running the model on continuous secondary outcomes as well.

Any other modifications you would propose based on this?  Thks in advance.

Respected Advisor
Posts: 2,655

Re: GLIMMIX for repeated measures

So there are three timepoints for fu (0 or initial, 3 weeks and 8 weeks) or perhaps just 2?  If so, then modify the type=ar(1) to type=un.  The marginal model is the way I would go at this point.

Steve Denham

Occasional Contributor
Posts: 9

Re: GLIMMIX for repeated measures

Thks again Steve for your timely response.

The fu time points are just 3 wks and 8 wks, no time 0.

Unfortunately when I run the model when specifying the correlation structure for:

random fu/residual subject=left(DOBID);

the model doesn't run.  When I leave out the correlation it runs fine.

I have about 1,000 patients, half had one machine (FLACS) and half had the current standard.  Not all of them had both eyes done.

Here's my code:

proc glimmix ;
class DOBID left flacs fu;

model mae_25 (ref='1') = flacs fu flacs*fu left /dist=bin link=logit cl oddsratio;

random int / subject=DOBID;

random fu/residual subject=left(DOBID); *type=ar(1) doesn't work;
random left/type=un subject=DOBID;

lsmeans flacs/cl ilink;
lsmeans flacs*fu/slicediff=fu cl ilink;
lsmeans fu/cl ilink;
run;

Respected Advisor
Posts: 2,655

Re: GLIMMIX for repeated measures

Before we go much farther, try type=cs for the covariance structure.  With only two points, it is a logical choice.

Steve Denham

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 1081 views
  • 2 likes
  • 3 in conversation