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.
Found it. Thanks! I will give it a try.
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.
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.
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!
I did run a lasso logistic regression with SAS glmselect (Y=1 for event and Y=-1 for non event). My syntax is something like:
proc glmselect data=<dataset> plots=all seed=123; output out=preds pred=individual; partition role=selected(train='1' test='0'); class Y AGE SEX; model Y = AGE SEX AGE*SEX /selection=lasso(choose=cv stop=none) cvmethod=random(10); run;
Everything works fine but I end-up with coefficients like that
SEXFemale*AGEYounger -0.9 SEXFemale*AGEOlder -0.7
Should I subtract -0.7 from -0.9 to find the relative effect of Younger age in the interaction with Sex?
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.