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
- /
- How to produce class labels in random logistic reg...

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
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-05-2013 10:23 AM

Hi folks;

I want to fit a repeated measure logistic regression with GLIMMIX and get the predicted class labels. The data was ordered by "id", the response is 0-1 coded variable "y", and there is one class variable "pwp". The code looks like this:

ods html close;

ods html;

proc glimmix data=test;

class pwp;

model y= pwp /dist=binary link=logit ddfm=kr2 solution ;

random _residual_ / subject=id;

output out=out1 pred(ilink)=predicted; *??;

run;

However I get confused about "OUTPUT keyword< (keyword-options) > <=name >" part of the code. There are four options available: 1. Linear predictor (default) 2. Marginal linear predictor (NOBLUP) 3. Predicted mean (ILINK) 4. Marginal mean (NOBLUP ILINK), and I don't know which of them should be used to calculate predicted class labels.

Any useful hints would be highly appreciated.

Issac

Accepted Solutions

Solution

04-06-2013
03:21 PM

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

Posted in reply to issac

04-06-2013 03:21 PM

All Replies

Solution

04-06-2013
03:21 PM

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

Posted in reply to issac

04-06-2013 03:21 PM

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

Posted in reply to 1zmm

04-07-2013 12:06 PM

@1zmm

Thanks for the hints. Is there any way in GLIMMIX to build a model on a portion of the data (train set) and then apply it to the rest (test set) to get the predictions?

Issac

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

Posted in reply to issac

04-07-2013 12:23 PM

One way is to create a new SAS data set that contains both the training data set with nonmissing, known values of the dependent variable

and the test data set with missing values for the dependent variable. Run this new SAS data set through PROC GLIMMIX using the model you specify, and write the predictions for both the training data set and the test data set to a new output SAS data set.

Another way, recently introduced in SAS, is to write the training and the test data to separate data sets and to use the SCORE= option to create a model with the training data set specified in the DATA= option and apply it to the test data set specified in the SCORE option. I'm not sure whether PROC GLIMMIX has the SCORE= option, but check the documentation for your version of PROC GLIMMIX to see if it is available for your use.

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

Posted in reply to 1zmm

04-07-2013 12:50 PM

@1zmm

Thanks for the prompt reply. For the second way, I found CODE statement in the GLIMMIX in which one can write data steps to compute predicted values of the fitted model. Is this work like SCORE= option in other SAS procedures or just something different?

Issac

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

Posted in reply to issac

04-07-2013 01:16 PM

If you have access to SAS/STAT version 12.1, the PROC GLIMMIX CODE statement seems to allow you to apply the results of an analysis of one data set to another data set to generate predictions in the same way as the SCORE= option in other SAS procedures.

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

Posted in reply to issac

06-20-2013 02:02 PM

I always delete the values of dependent variable in the test dataset and append them to the train dataset. So, in your case y = . for all test records. By just running GLIMMIX procedure for the entire data (train + test), GLIMMIX will automatically output the predicted y value for all records. I was able to get the same results by doing this.