<?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: cross sectional regression by month- NOT Rolling regression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/402033#M97591</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;right, thanks.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Oct 2017 03:32:20 GMT</pubDate>
    <dc:creator>Saba1</dc:creator>
    <dc:date>2017-10-07T03:32:20Z</dc:date>
    <item>
      <title>cross sectional regression by month- NOT Rolling regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/401187#M97308</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a panel data shown below with "id" identifies different stocks and "month" is monthly dates column. The data set is sorted by id and month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
  input id month x1 x2 y;
  datalines;
45  09/30/2004  -0.30  1.34  1
45  09/30/2004  -0.30  1.34  1
45  05/31/2005  -0.08  0.78  0
45  12/31/2008    .     .    0
48  09/30/2001  -0.01  1.88  1
48  02/28/2004   0.78  1.50  0
48  05/31/2005    .    0.54  1
49  01/31/2002   0.05   .    1     
51  03/31/2001  -0.06  1.48  0
55  05/31/2005   0.30  1.21  1
55  05/31/2005   0.30  1.21  1
55  11/30/2007   .      .    0
; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need to run cross sectional regression (proc reg) "by month". So the purpose is to &lt;STRONG&gt;observe variations in coefficient (beta) of "x2" over time i.e. over various months&lt;/STRONG&gt;. I am using following proc&amp;nbsp;but there is an Error saying "month" is not sorted in ascending order. When I sort the data by month and run the regression, resulting output gives "0" coefficients for missing values.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=have;
 model y=x1 x2;&lt;BR /&gt; by month; run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Kindly guide me in this regard. I also need to know how to create a data set based on time variant coefficients of only x2 along-with their corresponding months (date), and how to ultimately draw their graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 04:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/401187#M97308</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-10-05T04:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: cross sectional regression by month- NOT Rolling regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/401190#M97309</link>
      <description>&lt;P&gt;If I was right, you need make a new variable to flag MONTH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new_month=month(month);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then use it as a BY variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;reg&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="token procnames"&gt;model&lt;/SPAN&gt; y&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;x1 x2&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; new_&lt;SPAN class="token function"&gt;month&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I noticed your Y variable is 0 or 1. Maybe you need check PROC LOGISTIC .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 06:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/401190#M97309</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-05T06:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: cross sectional regression by month- NOT Rolling regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/401438#M97396</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt; thanks for the reply. Can I use the same By month statement in PROC LOGISTIC? Secondly how to create a data set &amp;amp; graph of only x2 betas (over time)?</description>
      <pubDate>Thu, 05 Oct 2017 16:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/401438#M97396</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-10-05T16:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: cross sectional regression by month- NOT Rolling regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/401753#M97504</link>
      <description>&lt;P&gt;Yes. I think so.&lt;/P&gt;
&lt;P&gt;for your second question, use OUTEST= option of PROC LOGISTIC to save the betas and use PROC SGPLOT to display it by month.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 13:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/401753#M97504</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-06T13:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: cross sectional regression by month- NOT Rolling regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/402033#M97591</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;right, thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 03:32:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cross-sectional-regression-by-month-NOT-Rolling-regression/m-p/402033#M97591</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-10-07T03:32:20Z</dc:date>
    </item>
  </channel>
</rss>

