<?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: Proc reg with year dummies in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378823#M19897</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/152943"&gt;@kelSAS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Can you please write SAS commands to run proc glm without year dummy?&lt;/P&gt;
&lt;P&gt;I have y(dependent var) and x1, x2, ..., x3 and year that has year figures. Thank you in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="http://www.lexjansen.com/mwsug/1999/paper15.pdf" target="_blank"&gt;http://www.lexjansen.com/mwsug/1999/paper15.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi22/STATS/PAPER267.PDF" target="_blank"&gt;http://www2.sas.com/proceedings/sugi22/STATS/PAPER267.PDF&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a lot of examples online. Note that there still are year dummy variables, you just don't have to code/create them. You may also want to review the parameterization&amp;nbsp;methods for creating dummy variables and how to specify that in SAS. The default is GLM coding while you probably want referential coding, even if you're not using that estimate.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2017 00:41:11 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-07-25T00:41:11Z</dc:date>
    <item>
      <title>Proc reg with year dummies</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378486#M19884</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to run a regression that has year dummy variables in the equation, and have two questions regarding it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First question is to do with how to include more than 30 year dummies in PROC REG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Currently,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I have created year dummies using the following code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data X;&lt;/P&gt;&lt;P&gt;set X;&lt;/P&gt;&lt;P&gt;array yrdummy(*) dy&amp;amp;startyr - dy&amp;amp;endyr;&lt;/P&gt;&lt;P&gt;do i=1 to dim(yrdummy);&lt;/P&gt;&lt;P&gt;if&amp;nbsp;fyear = i+&amp;amp;startyr&amp;nbsp;then yrdummy{i} = 1;&lt;/P&gt;&lt;P&gt;else yrdummy{i} = 0;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now, I am only test-running regression with 5 years (&amp;amp;startyr=2011 and &amp;amp;endyr=2015), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but I will eventually run with more than 30 years of data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I efficiently add these created dummy variables in my regression?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Second question is to do with regression outcome.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I run regression, I usually write the following code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc reg data=x outest=x1 noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;model y=x1 x2; *here I need to include yr dummies after x2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now, the outcome I need is the coefficients on x1 and x2, not the coefficients on yr dummies, and adj R-squared and number of observations.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;But when I use 'outest', I can't find R-square or number of observations.&amp;nbsp;Do I have to use other means for my output or is there a way to have coefficients, R2, n and other STATA-like information (SSR, SSE, SST etc)?&lt;/SPAN&gt;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 04:47:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378486#M19884</guid>
      <dc:creator>kelSAS</dc:creator>
      <dc:date>2017-07-23T04:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc reg with year dummies</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378492#M19885</link>
      <description>&lt;P&gt;I believe your array is fine, it should work even if you are having more than 30 years as you are using the macro variable for the start and end year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About the coefficients&lt;SPAN&gt;, and adj R-squared and number of observations. Please try to use th odes trace on and off as i used and in the log you get something as displayed. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;then in order to get the data into datasets try &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ods output parameterestimates=parameterestimates nobs=nobs ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc reg data=sashelp.class outest=x;&lt;BR /&gt;model age=height weight;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;ods output close;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the ods output statement will help you get the expected dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10480i245DAF7DA0D2C9C9/image-size/original?v=1.0&amp;amp;px=-1" alt="image.png" title="image.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 03:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378492#M19885</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-07-23T03:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc reg with year dummies</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378496#M19886</link>
      <description>&lt;P&gt;If you can use PROC GLM instead you can add the year variable as a CLASS variable and not have to create dummy variables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 05:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378496#M19886</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-23T05:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc reg with year dummies</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378818#M19896</link>
      <description>&lt;P&gt;Can you please write SAS commands to run proc glm without year dummy?&lt;/P&gt;&lt;P&gt;I have y(dependent var) and x1, x2, ..., x3 and year that has year figures. Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 00:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378818#M19896</guid>
      <dc:creator>kelSAS</dc:creator>
      <dc:date>2017-07-25T00:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc reg with year dummies</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378823#M19897</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/152943"&gt;@kelSAS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Can you please write SAS commands to run proc glm without year dummy?&lt;/P&gt;
&lt;P&gt;I have y(dependent var) and x1, x2, ..., x3 and year that has year figures. Thank you in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="http://www.lexjansen.com/mwsug/1999/paper15.pdf" target="_blank"&gt;http://www.lexjansen.com/mwsug/1999/paper15.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi22/STATS/PAPER267.PDF" target="_blank"&gt;http://www2.sas.com/proceedings/sugi22/STATS/PAPER267.PDF&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a lot of examples online. Note that there still are year dummy variables, you just don't have to code/create them. You may also want to review the parameterization&amp;nbsp;methods for creating dummy variables and how to specify that in SAS. The default is GLM coding while you probably want referential coding, even if you're not using that estimate.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 00:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-reg-with-year-dummies/m-p/378823#M19897</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-25T00:41:11Z</dc:date>
    </item>
  </channel>
</rss>

