Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
anonysas
Calcite | Level 5

Hi ,

Please tell me how to put a non-negative constraint on the regression coefficient in Lasso regression.
I use ETS or STAT.

 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

You can use HPGENSELECT to fit your model using the LASSO method in the SELECTION statement. It also has a RESTRICT statement that can be used to restrict parameters in the model. Unfortunately, model selection methods cannot be used together with parameter restrictions. However, after selecting a model, you can try refitting it by adding one or more RESTRICT statements to restrict parameters. For example, the following restricts the X4 parameter to be positive.

proc hpgenselect;
model y=x1 x2 x3 x4;
restrict x4 1 > 0;
run;

View solution in original post

4 REPLIES 4
japelin
Rhodochrosite | Level 12

Here is a Japanese community, so you may find it easier to get answers if you post here.
https://communities.sas.com/t5/SAS-Programming/bd-p/programming 

anonysas
Calcite | Level 5
Thank you for your concern.
StatDave
SAS Super FREQ

You can use HPGENSELECT to fit your model using the LASSO method in the SELECTION statement. It also has a RESTRICT statement that can be used to restrict parameters in the model. Unfortunately, model selection methods cannot be used together with parameter restrictions. However, after selecting a model, you can try refitting it by adding one or more RESTRICT statements to restrict parameters. For example, the following restricts the X4 parameter to be positive.

proc hpgenselect;
model y=x1 x2 x3 x4;
restrict x4 1 > 0;
run;
anonysas
Calcite | Level 5
I understood that it would be done in two steps.
Thank you.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register 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
  • 4 replies
  • 1182 views
  • 0 likes
  • 3 in conversation