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;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.