BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
YZ11
SAS Employee

Hi @SASdevAnneMarie , you can add SHOWL2SEARCH in the selection=
to displays an elastic net parameter summary table, which shows the chosen values for the LASSO regularization parameter L1 and the ridge regularization parameter L2 (in the ratio scaling). This option is available only when you specify SELECTION=ELASTICNET. You can provide the corresponding L1 and L2 values back to PROC GLMSELECT by specifying SELECTION=ELASTICNET(STOP=L1 L1CHOICE=RATIO L1=L1 value L2=L2 value).

SASdevAnneMarie
Rhodochrosite | Level 12
Hello YZ11,
Thank you, but I have this error : selection=elasticnet(choose=cv l1=0 l2search=grid stop=l1 l2=l2)
__
22
202
ERROR 22-322: Syntax error, expecting one of the following: a numeric constant, a datetime constant.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
YZ11
SAS Employee
This is caused by using l2=l2. The L2= option expects a numeric value, so you will specify something like l2=0.2. If you have a good estimate for the L2 penalty, you can provide it directly using L2=. If you do not specify L2=, then by default PROC GLMSELECT searches for an optimal value between 0 and 1 according to the current CHOOSE= criterion.
SASdevAnneMarie
Rhodochrosite | Level 12
Thank you. My question was how to display the chosen lambda criterion.
sbxkoenk
SAS Super FREQ

I have just done this:

ods graphics on;
proc glmselect data=sashelp.Leutrain 
               plots=coefficients;
   model y = x1-x4129/
   selection=elasticnet(choose=cv l1=0 l2search=grid stop=l1 SHOWL2SEARCH SHOWSTEPL1)
		     cvmethod=split(10);
run;

and I get (among many other output):

sbxkoenk_0-1778689996000.png

I think you want to see that value in the bottom of the table ("Chosen Value of L2").

 

BR,

Koen

SASdevAnneMarie
Rhodochrosite | Level 12
Thank you Koen!
I have a question : I have a quick question: L1 is 0, but we got L1 = 0.0004357571 as a result.
sbxkoenk
SAS Super FREQ

@SASdevAnneMarie wrote:
Thank you Koen!
I have a question : I have a quick question: L1 is 0, but we got L1 = 0.0004357571 as a result.

I cannot explain that. ☹️ 😞

 

  • I checked this usage note:
    Usage Note 60240: Regularization, regression penalties, LASSO, ridging, and elastic net
    https://support.sas.com/kb/60/240.html
  • and I checked this paper:
    Gunes, F. (2015). "Penalized Regression Methods for Linear Models in SAS/STAT®." Cary, NC: SAS Institute Inc.

but ... no luck.

 

Since you have opened a Technical Support ticket meanwhile, I would ask this over there.

 

BR,
Koen

SASdevAnneMarie
Rhodochrosite | Level 12
Thank you 🙂

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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
  • 22 replies
  • 496 views
  • 11 likes
  • 5 in conversation