BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
marianaalcos
Quartz | Level 8

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;

Captura de Tela 2018-06-26 às 11.52.26 AM.png

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

View solution in original post

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

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

marianaalcos
Quartz | Level 8
Hi Cynthia,

Sorry I didn't provide you with the code. Anyways, you gave me some valuable insights... I actually had tried ods select before, but since I didn't know how to find the name of the plot, it didn't work.

I just added the line
ods select CoefficientPlot ;
and it worked perfectly!! Thanks a lot!
WarrenKuhfeld
Ammonite | Level 13

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...

marianaalcos
Quartz | Level 8
Thank you Warren! That is helpful !!!

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1231 views
  • 2 likes
  • 3 in conversation