Hi ,
Please tell me how to put a non-negative constraint on the regression coefficient in Lasso regression.
I use ETS or STAT.
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;
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
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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.