<?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 Re: Out of sample predictions with PROC GLM in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Out-of-sample-predictions-with-PROC-GLM/m-p/178048#M45495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way is to append your additional observations to your input dataset and give them a frequency of zero (that way, even if they included dependant values, additional observations would be excluded from the regression)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data FULL / view=FULL;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set INPUT (in=inInput) ADDITIONAL;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where group=1 AND NB=0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;freq = inInput;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc glm data=FULL PLOTS=ALL;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;class C D;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;freq freq;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model X= A B C D/ solution;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output out=TEST(where=(not freq)) p=yhat r=resid;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Untested)&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Feb 2014 16:03:07 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2014-02-18T16:03:07Z</dc:date>
    <item>
      <title>Out of sample predictions with PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-of-sample-predictions-with-PROC-GLM/m-p/178047#M45494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm fairly new SAS and I'm trying to run some regressions using proc glm in Enterprise Guide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to run a basic OLS linear regression. The reason I'm using proc glm instead proc reg is so that I can use class variables. I read that proc reg does not support this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say I have a sample with 2000 observations, and I want to estimate a series of coeffecients for all the independant variables. So far I'm all good with the following lines of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------------&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;proc glm data=WORK.INPUT PLOTS=ALL;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;where group=1 AND NB=0;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;class C D;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;model X= A B C D/&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;solution;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;output out=WORK.TEST p=yhat r=resid;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;-------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have another dataset with an additional 20 000 observations. They all include the independant variables A - D, but lack the dependant X. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I predict X in this dataset, using the coefficients from the above stated regression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 15:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-of-sample-predictions-with-PROC-GLM/m-p/178047#M45494</guid>
      <dc:creator>Hauken</dc:creator>
      <dc:date>2014-02-18T15:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Out of sample predictions with PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-of-sample-predictions-with-PROC-GLM/m-p/178048#M45495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way is to append your additional observations to your input dataset and give them a frequency of zero (that way, even if they included dependant values, additional observations would be excluded from the regression)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data FULL / view=FULL;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set INPUT (in=inInput) ADDITIONAL;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where group=1 AND NB=0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;freq = inInput;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc glm data=FULL PLOTS=ALL;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;class C D;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;freq freq;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model X= A B C D/ solution;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output out=TEST(where=(not freq)) p=yhat r=resid;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Untested)&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:03:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-of-sample-predictions-with-PROC-GLM/m-p/178048#M45495</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-02-18T16:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Out of sample predictions with PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-of-sample-predictions-with-PROC-GLM/m-p/178049#M45496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PGs example is known as the "missing response trick": &lt;A href="http://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model/" title="http://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model/"&gt; The missing value trick for scoring a regression model - The DO Loop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;For other ways to score a data set, see &lt;A href="http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas/" title="http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas/"&gt; Techniques for scoring a regression model in SAS - The DO Loop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your example, I'd use the STORE statement followed by the PLM procedure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 15:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-of-sample-predictions-with-PROC-GLM/m-p/178049#M45496</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-02-19T15:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Out of sample predictions with PROC GLM</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Out-of-sample-predictions-with-PROC-GLM/m-p/178050#M45497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The STORE and PLM procedure is exactly what I was looking for. I found your blog post very useful Rick - thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 11:55:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Out-of-sample-predictions-with-PROC-GLM/m-p/178050#M45497</guid>
      <dc:creator>Hauken</dc:creator>
      <dc:date>2014-03-07T11:55:40Z</dc:date>
    </item>
  </channel>
</rss>

