<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic persist fitted model produced by proc glmselect in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319480#M16887</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to persist the model (formula) produced by proc glmselect like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC GLMSELECT DATA = WORK.Training TESTDATA = WORK.Test;
	class AW LN PM(ref="FP");
	MODEL
		Q = 
		FN
		DR
		AW 
		LN 
		PM / selection = none stb showpvalues;
	ods output 
	"Fit Statistics" = WORK.Model_Fit 
	"Parameter Estimates" = WORK.ParameterEstimates
	Nobs = WORK.Nobs;
RUN;&lt;/PRE&gt;&lt;P&gt;A cumbersome way would be to persits and parse the parameters in&amp;nbsp;&lt;SPAN&gt;WORK.ParameterEstimates and then create a dynamic datastep to apply the formula to unseen data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Surely there must be a simpler way? Any feedback would be very much appreciated. Thanks a lot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Christian&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Dec 2016 09:21:01 GMT</pubDate>
    <dc:creator>csetzkorn</dc:creator>
    <dc:date>2016-12-16T09:21:01Z</dc:date>
    <item>
      <title>persist fitted model produced by proc glmselect</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319480#M16887</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to persist the model (formula) produced by proc glmselect like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC GLMSELECT DATA = WORK.Training TESTDATA = WORK.Test;
	class AW LN PM(ref="FP");
	MODEL
		Q = 
		FN
		DR
		AW 
		LN 
		PM / selection = none stb showpvalues;
	ods output 
	"Fit Statistics" = WORK.Model_Fit 
	"Parameter Estimates" = WORK.ParameterEstimates
	Nobs = WORK.Nobs;
RUN;&lt;/PRE&gt;&lt;P&gt;A cumbersome way would be to persits and parse the parameters in&amp;nbsp;&lt;SPAN&gt;WORK.ParameterEstimates and then create a dynamic datastep to apply the formula to unseen data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Surely there must be a simpler way? Any feedback would be very much appreciated. Thanks a lot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Christian&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 09:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319480#M16887</guid>
      <dc:creator>csetzkorn</dc:creator>
      <dc:date>2016-12-16T09:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: persist fitted model produced by proc glmselect</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319483#M16888</link>
      <description>&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_glmselect_sect015.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_glmselect_sect015.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 09:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319483#M16888</guid>
      <dc:creator>chrej5am</dc:creator>
      <dc:date>2016-12-16T09:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: persist fitted model produced by proc glmselect</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319484#M16889</link>
      <description>&lt;P&gt;Thanks. I am aware of the SCORE statement but could you please provide some code top see how this would work in my described use case? Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 10:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319484#M16889</guid>
      <dc:creator>csetzkorn</dc:creator>
      <dc:date>2016-12-16T10:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: persist fitted model produced by proc glmselect</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319493#M16890</link>
      <description>&lt;P&gt;Here is an overview of scoring models in SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It depends a bit on your version but CODE is my current preference.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 10:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319493#M16890</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-16T10:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: persist fitted model produced by proc glmselect</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319524#M16891</link>
      <description>Thanks I am using version current version: 9.04.01M3P062415 and was aware of the quoted post. However, the outest option does not exist for PROC GLMSELECT IMHO. Some example code would be very much appreciated!</description>
      <pubDate>Fri, 16 Dec 2016 12:06:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319524#M16891</guid>
      <dc:creator>csetzkorn</dc:creator>
      <dc:date>2016-12-16T12:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: persist fitted model produced by proc glmselect</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319531#M16892</link>
      <description>&lt;P&gt;The blog post that Reeza mentions explains the STORE statement, which saves a model into a SAS "itemstore".&lt;/P&gt;
&lt;P&gt;You can then use PROC PLM to score the model. See the blog for details and for links to documentation and papers.&lt;/P&gt;
&lt;P&gt;The following example is a small modification of the code in the blog:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc GLMSELECT data=sashelp.cars;
model msrp = Cylinders EngineSize Horsepower Length 
             MPG_City MPG_Highway Weight Wheelbase;
store work.ScoreExample;     /* store the model */
quit;

/* selected model contains two explanatory variables:
   Horsepower and Wheelbase */
data NewData;
Horsepower = 200; Wheelbase = 100; output;
Horsepower = 250; Wheelbase = 110; output;
Horsepower = 180; Wheelbase = 95; output;
run;

proc plm restore=work.ScoreExample;
   score data=NewData out=Pred;  /* evaluate the model on new data */
run;

proc print data=Pred labels;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 12:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319531#M16892</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-12-16T12:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: persist fitted model produced by proc glmselect</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319564#M16893</link>
      <description>&lt;P&gt;Hi Rick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks this works great in isolation but for some unexplainable reason not for my ecxample, which is inside a macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC GLMSELECT DATA = WORK.Training TESTDATA = WORK.Test;
	class AW LN PM(ref="FP");
	MODEL
		Q = 
		FN
		DR
		AW 
		LN 
		PM / selection = none stb showpvalues;
	store work.ScoreExample;
	ods output 
	"Fit Statistics" = WORK.Model_Fit 
	"Parameter Estimates" = WORK.ParameterEstimates
	Nobs = WORK.Nobs;
RUN;&lt;/PRE&gt;&lt;P&gt;When I say it does not work, I cannot see a dataset&amp;nbsp;work.ScoreExample. Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 15:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319564#M16893</guid>
      <dc:creator>csetzkorn</dc:creator>
      <dc:date>2016-12-16T15:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: persist fitted model produced by proc glmselect</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319575#M16894</link>
      <description>&lt;P&gt;As discussed in the blog post, the model is not stored in a data set. &amp;nbsp;It is stored in an ITEM STORE. Item stores are explained on p. 3 and p. 6 of the Tobias and Cai (2010) paper that is linked to&amp;nbsp;in the blog post. &amp;nbsp;As it says on p. 6 of Tobias and Cai, you can use the SHOW statement in PROC PLM &amp;nbsp;to display an item store.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 16:06:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/persist-fitted-model-produced-by-proc-glmselect/m-p/319575#M16894</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-12-16T16:06:26Z</dc:date>
    </item>
  </channel>
</rss>

