The SAS Output Delivery System and reporting techniques

How to suppress "The selected Model..." Message in PROC GLMSELECT

Accepted Solution Solved
Reply
Contributor
Posts: 46
Accepted Solution

How to suppress "The selected Model..." Message in PROC GLMSELECT

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


Accepted Solutions
Solution
‎06-26-2018 08:58 PM
SAS Super FREQ
Posts: 9,433

Re: How to suppress "The selected Model..." Message in PROC GLMSELECT

[ Edited ]
Posted in reply to marianaalcos

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


All Replies
Solution
‎06-26-2018 08:58 PM
SAS Super FREQ
Posts: 9,433

Re: How to suppress "The selected Model..." Message in PROC GLMSELECT

[ Edited ]
Posted in reply to marianaalcos

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

Contributor
Posts: 46

Re: How to suppress "The selected Model..." Message in PROC GLMSELECT

Posted in reply to Cynthia_sas
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!
SAS Super FREQ
Posts: 508

Re: How to suppress "The selected Model..." Message in PROC GLMSELECT

Posted in reply to marianaalcos

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

Contributor
Posts: 46

Re: How to suppress "The selected Model..." Message in PROC GLMSELECT

Posted in reply to WarrenKuhfeld
Thank you Warren! That is helpful !!!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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