BookmarkSubscribeRSS Feed
jindalrp
Calcite | Level 5

Is there a way to include 2 class variables in Lasso regression by default? Basically I want to allow Lasso to choose from among a list of continuous variables but want to include 2 class variables (one has 9 categories and the other has 6 categories) for sure. I am using SAS version 9.3 X64_8PRO.

 

Thank you.

3 REPLIES 3
Ksharp
Super User
Unfortunately, INCLUDE= option is not available for PROC GLMSELECT.

But INCLUDE= option is available for PROC HPGENSELECT .



Rick_SAS
SAS Super FREQ

You can run a regression on the two variables, then use the residuals as the response in PROC GLMSELECT. It might look something like this:

 

proc glm data=Have;
   class C1 C2;
   model Y = C1 C2;
   output out=Residuals r=NewY;
run;

proc glmselect data=Residuals;
   model NewY = x1 - x1000;
   ...
run;
jindalrp
Calcite | Level 5

Thank you for your replies.

@Rick_SAS, I had done exactly this but was wondering if I could do it all in one step for cleaner presentation of methodology and results.

@Ksharp, is there a way to run proc hpgenselect in SAS 9.3 TS Level 1M2, X64_8PRO platform?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 1323 views
  • 2 likes
  • 3 in conversation