turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- proc glimmix question

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-19-2010 01:13 AM

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;

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;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-19-2010 07:41 PM

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-20-2010 05:18 AM

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

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