<?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 Rolling regression-firm specific volatility and skewness in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rolling-regression-firm-specific-volatility-and-skewness/m-p/517475#M139915</link>
    <description>&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Hello,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;I am trying to compute firm specific volatility and skewness using monthly stock returns calculated from CRSP monthly stock&amp;nbsp;prices.&lt;/FONT&gt; &lt;FONT size="4"&gt;&lt;FONT face="times new roman,times"&gt;&lt;FONT face="times new roman,times"&gt;&lt;SPAN&gt;To be included in the return tests for July of year &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;t&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;, a firm must have Compustat/CRSP data for December of year &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;t &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;− &lt;/SPAN&gt;&lt;SPAN&gt;1 and June of year &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;t&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;. It must also have monthly returns for at least 24 of the 36 &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="times new roman,times"&gt;&lt;SPAN&gt;months preceding July of year &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;t &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;in order to calculate the&amp;nbsp;firms’ volatility and skewness and the firm’s beta. Furthermore, I will proceed with Fama-MacBeth rolling procedure.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="2"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;SPAN&gt;&lt;SPAN style="font-size: 14pt;"&gt;I have found one macro&amp;nbsp;for rolling regression (see attachment)&amp;nbsp;and call it as it is below:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="2"&gt;%&lt;STRONG&gt;&lt;I&gt;rollingreg&lt;/I&gt;&lt;/STRONG&gt; (data= Crsp_Comp, out_ds=_outest_ds , id=permno , date=date , model_equation= ex_ret_mon= market_premium ,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="2"&gt;start_date=&lt;STRONG&gt;&lt;FONT color="#008080"&gt;1980&lt;/FONT&gt;&lt;/STRONG&gt; , end_date= &lt;STRONG&gt;&lt;FONT color="#008080"&gt;2010&lt;/FONT&gt;&lt;/STRONG&gt;, freq=month, s=&lt;STRONG&gt;&lt;FONT color="#008080"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;, n=&lt;STRONG&gt;&lt;FONT color="#008080"&gt;36&lt;/FONT&gt;&lt;/STRONG&gt;,regprint=yes);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Then I saved the residuals of the regression and compute&amp;nbsp;the standard deviation of the&amp;nbsp;residuals for the volatility measure and skewness respectively but does not seem to work.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Can anyone help me with that?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Thank you in advance.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Nov 2018 14:03:00 GMT</pubDate>
    <dc:creator>MarinaMag</dc:creator>
    <dc:date>2018-11-30T14:03:00Z</dc:date>
    <item>
      <title>Rolling regression-firm specific volatility and skewness</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-regression-firm-specific-volatility-and-skewness/m-p/517475#M139915</link>
      <description>&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Hello,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;I am trying to compute firm specific volatility and skewness using monthly stock returns calculated from CRSP monthly stock&amp;nbsp;prices.&lt;/FONT&gt; &lt;FONT size="4"&gt;&lt;FONT face="times new roman,times"&gt;&lt;FONT face="times new roman,times"&gt;&lt;SPAN&gt;To be included in the return tests for July of year &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;t&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;, a firm must have Compustat/CRSP data for December of year &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;t &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;− &lt;/SPAN&gt;&lt;SPAN&gt;1 and June of year &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;t&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;. It must also have monthly returns for at least 24 of the 36 &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="times new roman,times"&gt;&lt;SPAN&gt;months preceding July of year &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;t &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;in order to calculate the&amp;nbsp;firms’ volatility and skewness and the firm’s beta. Furthermore, I will proceed with Fama-MacBeth rolling procedure.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="2"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;SPAN&gt;&lt;SPAN style="font-size: 14pt;"&gt;I have found one macro&amp;nbsp;for rolling regression (see attachment)&amp;nbsp;and call it as it is below:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="2"&gt;%&lt;STRONG&gt;&lt;I&gt;rollingreg&lt;/I&gt;&lt;/STRONG&gt; (data= Crsp_Comp, out_ds=_outest_ds , id=permno , date=date , model_equation= ex_ret_mon= market_premium ,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="2"&gt;start_date=&lt;STRONG&gt;&lt;FONT color="#008080"&gt;1980&lt;/FONT&gt;&lt;/STRONG&gt; , end_date= &lt;STRONG&gt;&lt;FONT color="#008080"&gt;2010&lt;/FONT&gt;&lt;/STRONG&gt;, freq=month, s=&lt;STRONG&gt;&lt;FONT color="#008080"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;, n=&lt;STRONG&gt;&lt;FONT color="#008080"&gt;36&lt;/FONT&gt;&lt;/STRONG&gt;,regprint=yes);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Then I saved the residuals of the regression and compute&amp;nbsp;the standard deviation of the&amp;nbsp;residuals for the volatility measure and skewness respectively but does not seem to work.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Can anyone help me with that?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Thank you in advance.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 14:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-regression-firm-specific-volatility-and-skewness/m-p/517475#M139915</guid>
      <dc:creator>MarinaMag</dc:creator>
      <dc:date>2018-11-30T14:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling regression-firm specific volatility and skewness</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-regression-firm-specific-volatility-and-skewness/m-p/517946#M140103</link>
      <description>&lt;P&gt;By "returns test for July of year t" do you mean a window ending June 30 of year t, or do you mean a window endow July 31 of year t?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you only want the "July" windows, or do you want windows for every month?&amp;nbsp; And if you mean every month, then are you still saying you want December data for year t-1, or do you merely mean 7 months prior to the window ending month?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears you want 36-month long windows, but will accept up to 12 monthly "holes" in that 36 months, correct?&amp;nbsp; Which means, at the beginning of your time series, you can have a 24-month window, then a 25-month windows, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a company with complete monthly data for Jan 1980 through Dec 2010, (31 years), there will&amp;nbsp;31*12 - 23 = 349 regressions for each PERMNO.&amp;nbsp; So if you have, say,&amp;nbsp;500 firms, you'll be constructing 174,500 windows.&amp;nbsp;&amp;nbsp; PROC SQL, which is in the macro you found, is not an efficient way to prepare this data.&amp;nbsp; Since&amp;nbsp;crsp/compustat data are almost certainly sorted by permno/date (they are at WRDS), you'll be better off either using a data step&amp;nbsp;make window raw data set view, or&amp;nbsp;possibly&amp;nbsp;a view+proc expand to create rolling sums-of-squares for the regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 01:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-regression-firm-specific-volatility-and-skewness/m-p/517946#M140103</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-12-03T01:52:09Z</dc:date>
    </item>
  </channel>
</rss>

