BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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;
2 REPLIES 2
Dale
Pyrite | Level 9
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 /
        ilink;
  estimate "Prediction for 2nd subject"
        intercept 1
        q103r 59
      | q03 0 1 /
        ilink;
...
  estimate "Prediction for 10th subject"
        intercept 1
        q103r 59
      | q03 0 0 0 0 0 0 0 0 0 1 /
        ilink;
...
  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 /
        ilink;
...
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.
deleted_user
Not applicable
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1459 views
  • 0 likes
  • 2 in conversation