- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am trying to run a lasso model specification analysis on a dataset and when I specify variables using the CLASS function to create dummies for categorical variables, I do not see them included in the Lasso step analysis. I tried it on a sashelp dataset with code below and the same thing happened. In both cases the CLASS variables do come up in the results window in the "Class Level Information" and "Dimensions" but are not included in the lasso step nor the final selected model. Does anybody know how to include those class dummy variables into the step analysis? I'm not sure how to add my results viewer output but if that is necessary for you to see it, please let me know how and I'd be happy to add it.
Title 'Lasso';
proc glmselect data=heart plots(stepaxis=normb)=all;
CLASS sex bp_status status;
MODEL cholesterol = height weight smoking
/selection = lasso(stop=none choose=cvex);
run;
Cheers,
Peter
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You didn't include the variables in your MODEL statement.
Including them in the CLASS statement tells SAS they're categorical but does not include them in your model by default. Once you add them to your model statement you'll see the output you expect.
@PeterBr wrote:
Hi All,
I am trying to run a lasso model specification analysis on a dataset and when I specify variables using the CLASS function to create dummies for categorical variables, I do not see them included in the Lasso step analysis. I tried it on a sashelp dataset with code below and the same thing happened. In both cases the CLASS variables do come up in the results window in the "Class Level Information" and "Dimensions" but are not included in the lasso step nor the final selected model. Does anybody know how to include those class dummy variables into the step analysis? I'm not sure how to add my results viewer output but if that is necessary for you to see it, please let me know how and I'd be happy to add it.
Title 'Lasso';
proc glmselect data=heart plots(stepaxis=normb)=all;
CLASS sex bp_status status;
MODEL cholesterol = height weight smoking
/selection = lasso(stop=none choose=cvex);
run;
Cheers,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You didn't include the variables in your MODEL statement.
Including them in the CLASS statement tells SAS they're categorical but does not include them in your model by default. Once you add them to your model statement you'll see the output you expect.
@PeterBr wrote:
Hi All,
I am trying to run a lasso model specification analysis on a dataset and when I specify variables using the CLASS function to create dummies for categorical variables, I do not see them included in the Lasso step analysis. I tried it on a sashelp dataset with code below and the same thing happened. In both cases the CLASS variables do come up in the results window in the "Class Level Information" and "Dimensions" but are not included in the lasso step nor the final selected model. Does anybody know how to include those class dummy variables into the step analysis? I'm not sure how to add my results viewer output but if that is necessary for you to see it, please let me know how and I'd be happy to add it.
Title 'Lasso';
proc glmselect data=heart plots(stepaxis=normb)=all;
CLASS sex bp_status status;
MODEL cholesterol = height weight smoking
/selection = lasso(stop=none choose=cvex);
run;
Cheers,
Peter