N/A
Posts: 0

# proc glimmix question

Dear friends,
After running proc nlmixed, I can make predictions (PREDICT_1) using the entire estimated equation (along with the random error term u) and conduct some post-estimation analyses as in the example below. Is there a way of doing this in PROC GLIMMIX and how would I do it. Thank you for any help you can give me.

proc nlmixed data=xxx;

eta1=theta + b_Q103R*q103r + u;

PREDICT_1=THETA + B_Q103R*59 + U;*******
pq103r1=exp(predict_1)/(1+EXP(predict_1));*****

p_q327=exp(ETA1)/(1+EXP(ETA1));
LL=(p_q327);
model q327~binary(ll);
random u ~ normal(0,s2u) subject=q03;

predict pq103r1 out=out_pq103r1; ******
run;
Regular Contributor
Posts: 171

## Re: proc glimmix question

Yes, you can obtain predicted values from the GLIMMIX procedure. However, it is probably not quite as easy to write the code in GLIMMIX because you need to write an ESTIMATE statement for every subject. Thus, you would need code like the following:

ods output Estimates=Predictions;
proc glimmix data=xxx;
class q03;
model q327 = q103r / dist=binary;
random q03;
estimate "Prediction for 1st subject"
intercept 1
q103r 59
| q03 1 /
estimate "Prediction for 2nd subject"
intercept 1
q103r 59
| q03 0 1 /
...
estimate "Prediction for 10th subject"
intercept 1
q103r 59
| q03 0 0 0 0 0 0 0 0 0 1 /
...
estimate "Prediction for 20th subject"
intercept 1
q103r 59
| q03 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 /
...
run;

Note that each estimate statement specifies the same linear combination of the fixed effects but picks up a different column of the random effect q03. We need a separate ESTIMATE statement for each level of q03. In addition, in order to predict the expected probability value (rather than eta), we need the ILINK option on each ESTIMATE statement.

Note, too, the use of the vertical bar (|) before the random effect q03 in ESTIMATE statement. The vertical bar indicates that the terms which follow are found in the random effects structure.

Additionally, it should be observed that you will not get the same results out of the ESTIMATE statement if you specify the RANDOM statement as

random intercept / subject=r03;

The GLIMMIX procedure makes model specification much easier than does the NLMIXED procedure. However, obtaining predicted values conditional on levels of the random effects is considerably easier in NLMIXED.
N/A
Posts: 0

## Re: proc glimmix question

Hi Dale,
Thank you very much for your prompt response. Not quite the answer I was hoping for!, but at least I can give up on that direction. Thank you again.
K
Discussion stats
• 2 replies
• 226 views
• 0 likes
• 2 in conversation