<?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 Predictive regression on next year's independent variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Predictive-regression-on-next-year-s-independent-variables/m-p/586560#M167438</link>
    <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently using a macro to run rolling regressions where every year the data size increases, i.e. 2009, 2009-2010, 2009-2011 etc., with the following code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;ods graphics off;&lt;/DIV&gt;&lt;DIV&gt;ods listing close;&lt;/DIV&gt;&lt;DIV&gt;%macro loopOverYears;&lt;/DIV&gt;&lt;DIV&gt;%do i=2009 %to 2018;&lt;/DIV&gt;&lt;DIV&gt;ods output ParameterEstimates=Output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;proc sort data=import; by GIC_SECT Year;&lt;/DIV&gt;&lt;DIV&gt;proc glm data=import;&lt;/DIV&gt;&lt;DIV&gt;class GIC_SECT Year;&lt;/DIV&gt;&lt;DIV&gt;model logtotal = GIC_SECT Year logrev logassets logcapx gmar levg / solution;&lt;/DIV&gt;&lt;DIV&gt;where year&amp;lt;=&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%if &amp;amp;i = 2009 %then %do;&lt;/DIV&gt;&lt;DIV&gt;data AllEstimates;&lt;/DIV&gt;&lt;DIV&gt;set output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;endYear=&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;%end;&lt;/DIV&gt;&lt;DIV&gt;%else %do;&lt;/DIV&gt;&lt;DIV&gt;data output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;set output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;endYear=&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;data AllEstimates;&lt;/DIV&gt;&lt;DIV&gt;set AllEstimates output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;%end;&lt;/DIV&gt;&lt;DIV&gt;%end;&lt;/DIV&gt;&lt;DIV&gt;ods listing;&lt;/DIV&gt;&lt;DIV&gt;%mend;&lt;/DIV&gt;&lt;DIV&gt;%loopOverYears;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;From here, I need to be able to use the coefficients from these regression results to predict next year's logtotal based on next year's independent variables (GIC_SECT Year logrev logassets logcapx gmar levg). For example, I would run a regression for a data subset 2009-2015 and then use these results to predict logtotal in 2016 based on the independent variables in 2016.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Does anyone know how I might accomplish this?&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Thu, 05 Sep 2019 21:21:44 GMT</pubDate>
    <dc:creator>wryd078</dc:creator>
    <dc:date>2019-09-05T21:21:44Z</dc:date>
    <item>
      <title>Predictive regression on next year's independent variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-regression-on-next-year-s-independent-variables/m-p/586560#M167438</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently using a macro to run rolling regressions where every year the data size increases, i.e. 2009, 2009-2010, 2009-2011 etc., with the following code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;ods graphics off;&lt;/DIV&gt;&lt;DIV&gt;ods listing close;&lt;/DIV&gt;&lt;DIV&gt;%macro loopOverYears;&lt;/DIV&gt;&lt;DIV&gt;%do i=2009 %to 2018;&lt;/DIV&gt;&lt;DIV&gt;ods output ParameterEstimates=Output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;proc sort data=import; by GIC_SECT Year;&lt;/DIV&gt;&lt;DIV&gt;proc glm data=import;&lt;/DIV&gt;&lt;DIV&gt;class GIC_SECT Year;&lt;/DIV&gt;&lt;DIV&gt;model logtotal = GIC_SECT Year logrev logassets logcapx gmar levg / solution;&lt;/DIV&gt;&lt;DIV&gt;where year&amp;lt;=&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%if &amp;amp;i = 2009 %then %do;&lt;/DIV&gt;&lt;DIV&gt;data AllEstimates;&lt;/DIV&gt;&lt;DIV&gt;set output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;endYear=&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;%end;&lt;/DIV&gt;&lt;DIV&gt;%else %do;&lt;/DIV&gt;&lt;DIV&gt;data output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;set output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;endYear=&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;data AllEstimates;&lt;/DIV&gt;&lt;DIV&gt;set AllEstimates output&amp;amp;i;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;%end;&lt;/DIV&gt;&lt;DIV&gt;%end;&lt;/DIV&gt;&lt;DIV&gt;ods listing;&lt;/DIV&gt;&lt;DIV&gt;%mend;&lt;/DIV&gt;&lt;DIV&gt;%loopOverYears;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;From here, I need to be able to use the coefficients from these regression results to predict next year's logtotal based on next year's independent variables (GIC_SECT Year logrev logassets logcapx gmar levg). For example, I would run a regression for a data subset 2009-2015 and then use these results to predict logtotal in 2016 based on the independent variables in 2016.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Does anyone know how I might accomplish this?&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 05 Sep 2019 21:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-regression-on-next-year-s-independent-variables/m-p/586560#M167438</guid>
      <dc:creator>wryd078</dc:creator>
      <dc:date>2019-09-05T21:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive regression on next year's independent variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-regression-on-next-year-s-independent-variables/m-p/588660#M168267</link>
      <description>&lt;P&gt;These&amp;nbsp;three articles should help you out. They give an exhaustive answer to your scoring question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&lt;/P&gt;
&lt;P&gt;Techniques for scoring a regression model in SAS&lt;/P&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;&lt;TIME title="2014-02-19" class="value-title" datetime="2014-02-19T05:20:33-04:00"&gt;By Rick Wicklin on The DO Loop&amp;nbsp; February 19, 2014&lt;/TIME&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;&lt;A href="https://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;2.&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Paper SAS3337-2019 &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;SCORE! Techniques for Scoring Predictive Regression Models Using SAS/STAT&lt;/FONT&gt;&lt;FONT size="1"&gt;® &lt;/FONT&gt;&lt;FONT size="4"&gt;Software &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Phil Gibbs and Randy Tobias, SAS Institute Inc.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3337-2019.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3337-2019.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;3.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;Usage Note &lt;I&gt;33307: &lt;/I&gt;Scoring (computing predicted values) for new observations or a validation data set&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;&lt;A href="http://support.sas.com/kb/33/307.html" target="_blank"&gt;http://support.sas.com/kb/33/307.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;As you will clearly notice, you have multiple options to achieve what you are after.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;Koen&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Sep 2019 20:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-regression-on-next-year-s-independent-variables/m-p/588660#M168267</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2019-09-13T20:30:58Z</dc:date>
    </item>
  </channel>
</rss>

