Hi guys,
I want to run a LASSO REGRESSION using the whole path, but I want to display only the plots. I was able to get rid of everything, but the message displaying "The selected model is...." (see pic below). I used ods exclude to exclude all the tables but I could not find the table/argument that corresponds to that message (and now it's looking ugly in my report).
How do I do that? Check pic and code below !
title 'Part 2 - Lasso Regression';
title2 'Printing the whole Lasso Path first';
proc glmselect data=data plots(unpack stepaxis=normb)=coefficients ;
model y=x1-x20 /
selection=lasso (stop=none);
ods exclude ANOVA SelectionSummary SelectedEffects
ParameterEstimates ModelInfo Dimensions FitStatistics ModelInfo
NObs ; /*suppresses reports and displays only plot */
run;
Hi: Do you get the same results if you use an ODS SELECT to select only the graph object you want? What happens if you use use ODS NOPTITLE? That should get rid of "The GLMSELECT Procedure" -- but I'm not sure whether it will get rid of "Selected Model" too.
If you turn ODS TRACE ON/ LABEL; before your current step, you should see ALL the output objects that have not been excluded. How many output objects are you going to get based on ODS TRACE ON results in the log? Is GLMSELECT one of the procedures that ends with a QUIT and not just a RUN? I find it interesting that you are getting this note AFTER the graph and it looks like AFTER a page break too. Do you have GTITLE and GFOOTNOTE options turned on? I wonder if that note is supposed to be part of the graph but is thrown outside by a NOGTITLE or NOGFOOTNOTE, since you didn't show the top of the image, it's hard to guess. Where do your title statements appear -- inside the box of the graph, or outside the box of the graph?
You didn't post any data, so nobody can test your code. However, when I ran a test using SASHELP.BASEBALL and used ODS SELECT instead of ODS EXCLUDE and just selected the Criterion Plot, which is what I think you want, I did not get that message. Here's what I tried:
title 'Part 2 - Lasso Regression';
title2 'Printing the whole Lasso Path first';
ods noptitle;
ods html path='c:\temp' (url=none) file='want_c_plot.html';
ods select ChooseCriterionPlot;
proc glmselect data=sashelp.baseball
plots(unpack stepaxis=normb)=coefficients ;
class league division;
model Salary = nAtBat nHits nHome nRuns nRBI nBB
yrMajor crAtBat crHits crHome crRuns crRbi
crBB league division nOuts nAssts nError /
selection=lasso (stop=none);
run;
ods html close;
Cynthia
Hi: Do you get the same results if you use an ODS SELECT to select only the graph object you want? What happens if you use use ODS NOPTITLE? That should get rid of "The GLMSELECT Procedure" -- but I'm not sure whether it will get rid of "Selected Model" too.
If you turn ODS TRACE ON/ LABEL; before your current step, you should see ALL the output objects that have not been excluded. How many output objects are you going to get based on ODS TRACE ON results in the log? Is GLMSELECT one of the procedures that ends with a QUIT and not just a RUN? I find it interesting that you are getting this note AFTER the graph and it looks like AFTER a page break too. Do you have GTITLE and GFOOTNOTE options turned on? I wonder if that note is supposed to be part of the graph but is thrown outside by a NOGTITLE or NOGFOOTNOTE, since you didn't show the top of the image, it's hard to guess. Where do your title statements appear -- inside the box of the graph, or outside the box of the graph?
You didn't post any data, so nobody can test your code. However, when I ran a test using SASHELP.BASEBALL and used ODS SELECT instead of ODS EXCLUDE and just selected the Criterion Plot, which is what I think you want, I did not get that message. Here's what I tried:
title 'Part 2 - Lasso Regression';
title2 'Printing the whole Lasso Path first';
ods noptitle;
ods html path='c:\temp' (url=none) file='want_c_plot.html';
ods select ChooseCriterionPlot;
proc glmselect data=sashelp.baseball
plots(unpack stepaxis=normb)=coefficients ;
class league division;
model Salary = nAtBat nHits nHome nRuns nRBI nBB
yrMajor crAtBat crHits crHome crRuns crRbi
crBB league division nOuts nAssts nError /
selection=lasso (stop=none);
run;
ods html close;
Cynthia
I am glad that Cynthia was able to help you! In cases where ODS SELECT/EXCLUDE are not sufficient, you can use the ODS DOCUMENT as is illustrated in this blog. https://blogs.sas.com/content/graphicallyspeaking/2016/11/23/advanced-ods-graphics-remove-ods-subtit...
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.