<?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: calculate SKEWNESS  of residual in a rolling window regression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calculate-SKEWNESS-of-residual-in-a-rolling-window-regression/m-p/909715#M358808</link>
    <description>&lt;P&gt;Please show a sample of the data, in the form of a working data step - so that proposed code can be tested.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In particular, how are you constructing data to be submitted for rolling window regressions?&lt;/P&gt;</description>
    <pubDate>Tue, 26 Dec 2023 23:23:51 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2023-12-26T23:23:51Z</dc:date>
    <item>
      <title>calculate SKEWNESS  of residual in a rolling window regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-SKEWNESS-of-residual-in-a-rolling-window-regression/m-p/909670#M358788</link>
      <description>&lt;P&gt;Hi SAS expert, I'm trying to calculate idiosyncratic skewness of residual in a rolling regression using past 6 months data. The regression is regress individaul stock return on market return:&lt;/P&gt;&lt;P&gt;reg ret mktret&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each month t, I run the regression using t-1 to t-6 data, and get the residual and calculate skewness of residual&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2023 03:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-SKEWNESS-of-residual-in-a-rolling-window-regression/m-p/909670#M358788</guid>
      <dc:creator>Nieves</dc:creator>
      <dc:date>2023-12-26T03:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: calculate SKEWNESS  of residual in a rolling window regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-SKEWNESS-of-residual-in-a-rolling-window-regression/m-p/909715#M358808</link>
      <description>&lt;P&gt;Please show a sample of the data, in the form of a working data step - so that proposed code can be tested.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In particular, how are you constructing data to be submitted for rolling window regressions?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2023 23:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-SKEWNESS-of-residual-in-a-rolling-window-regression/m-p/909715#M358808</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2023-12-26T23:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: calculate SKEWNESS  of residual in a rolling window regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-SKEWNESS-of-residual-in-a-rolling-window-regression/m-p/909751#M358813</link>
      <description>&lt;P&gt;1. Are you using forward, backward, or centered windows?&lt;/P&gt;
&lt;P&gt;2. For the regression, do you want a least-squares regression for k=6 time points, or do you want a moving average?&lt;/P&gt;
&lt;P&gt;3. Do you have access to SAS IML software?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can review common moving-window statistics by reading the article, &lt;A href="https://blogs.sas.com/content/iml/2016/01/27/moving-average-in-sas.html" target="_self"&gt;"Compute a moving average in SAS."&lt;/A&gt;&lt;BR /&gt;Since the skewness of residuals for a moving regression is not built into any SAS procedure, I suggest you program it yourself in the SAS IML Language. The basic ideas are shown in the article, &lt;A href="https://blogs.sas.com/content/iml/2016/02/03/rolling-statistics-sasiml.html" target="_self"&gt;"Rolling Statistics in SAS/IML".&lt;/A&gt;&amp;nbsp;A second article on rolling medians shows &lt;A href="https://blogs.sas.com/content/iml/2021/05/26/running-median-smoother.html" target="_self"&gt;how to extract the data from a rolling window.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would tackle this problem in two steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Extract the data from the rolling window, &lt;A href="https://blogs.sas.com/content/iml/2011/08/10/do-you-really-need-to-compute-that-matrix-inverse.html" target="_self"&gt;solve the normal equations to get the parameter estimates&lt;/A&gt;, and construct the residuals (which gives you a NEW series!).&lt;/LI&gt;
&lt;LI&gt;Compute the rolling skewness of the residuals.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 27 Dec 2023 11:53:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-SKEWNESS-of-residual-in-a-rolling-window-regression/m-p/909751#M358813</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-12-27T11:53:33Z</dc:date>
    </item>
  </channel>
</rss>

