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
- /
- SAS Programming
- /
- SAS Procedures
- /
- LASSO in Logistic regression

Topic Options

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

06-16-2014 10:11 AM

Hi,

I was just wondering if there is any way to use LASSO & ELASTIC NET in logistic regression model using SAS.

Any help or suggestions will be much appreciated.

Lovedeep

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

Posted in reply to lovedeep

06-16-2014 01:32 PM

Look into PROC GLMSELECT. You may need to transform your dependent variable onto the logit scale before fitting.

Steve Denham

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

Posted in reply to SteveDenham

06-16-2014 03:19 PM

Thanks Steve,

But can you please guide me for the best way to accomplish it.

Thanks

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

Posted in reply to lovedeep

06-16-2014 03:40 PM

Get your data into the events/trials syntax, if it is not already. Apply a logit transform to the dependent variable, and run GLMSELECT with the LASSO option.

Steve Denham

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

Posted in reply to lovedeep

04-30-2015 10:19 AM

Lasso variable selection **is** available for logistic regression in the latest version of the HPGENSELECT procedure (SAS/STAT 13.1 included in Base SAS 9.4).

Elastic net isn't supported quite yet. However if you're interested I can send you my Base SAS coding solution for lasso + elastic net for logistic and Poisson regression which I just presented at the 2015 SAS Global Forum.

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

Posted in reply to RobF

05-06-2015 12:53 PM

Found it. Thanks! I will give it a try.

http://support.sas.com/resources/papers/proceedings15/3297-2015.pdf

Google also found another suggestion for use of GLMSELECT. Code dichotomous outcome as +-1, run GLMSELECT and apply cutoff > 0. Will give that a try as well.

Thanks,

Haris

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

Posted in reply to Haris

05-06-2015 02:34 PM

You're welcome, let me know if you have questions about the program.

The code will generate & output logistic regression coefficient estimates for selected values of the alpha & lambda parameters, but I haven't yet written code that selects the optimal alpha & lambda values for the elastic net model. You could do this using 5 or 10-fold cross validation, or else randomly split your data into two chunks, training and validation. Fit the elastic net models for varying alpha & lambda values with the training data, then score the validation dataset with the output model coefficients & compare predictive accuracy.

I haven't tried the GLMSELECT shortcut using +1/-1 but would be interested to see how it performs.

Robert

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

Posted in reply to RobF

07-01-2015 04:33 PM

Hello Robert,

I also need to use LASSO in logistic regression model in SAS and my SAS version doesn't have HPGENSELECT procedure. Could you mind sending me the link of your Base SAS coding solution for lasso for logistic and Poisson regression presented at the 2015 SAS Global Forum?

Thank you very much and I appreciate your help!

Fiona