<?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: Monthly rolling average in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Monthly-rolling-average/m-p/96852#M27325</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without seeing some sample data, suggestions can't be specific:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If you have SAS/ETS, then Proc Expand is your best bet. Rolling Average is just one of its build-in functions.&lt;/P&gt;&lt;P&gt;2. If you choose to use Proc SQL like being suggested, 'group by' needs to be applied on an unique id of every row from t1. &lt;/P&gt;&lt;P&gt;3. Data step, by using temporary array, mod() and/or&amp;nbsp; 'by' processing. Please search 'rolling' or 'moving' in the forum, you will see many posts with similar questions and answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Haikuo. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Feb 2013 18:01:18 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2013-02-04T18:01:18Z</dc:date>
    <item>
      <title>Monthly rolling average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Monthly-rolling-average/m-p/96850#M27323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to compute monthly rolling averages and my dates are in the format YYYYMM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope someone will be familiar with codes like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 14:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Monthly-rolling-average/m-p/96850#M27323</guid>
      <dc:creator>Benn</dc:creator>
      <dc:date>2013-02-04T14:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly rolling average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Monthly-rolling-average/m-p/96851#M27324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its useful to have sample data...but...3 month rolling average&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.dt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,avg(t2.....???) as monthly_rolling_avg&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; want t1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join want t2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2.date between intnx('month',t1.date,-3) and t1.date&lt;/P&gt;&lt;P&gt;group by t1.dt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 14:16:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Monthly-rolling-average/m-p/96851#M27324</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-04T14:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly rolling average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Monthly-rolling-average/m-p/96852#M27325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without seeing some sample data, suggestions can't be specific:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If you have SAS/ETS, then Proc Expand is your best bet. Rolling Average is just one of its build-in functions.&lt;/P&gt;&lt;P&gt;2. If you choose to use Proc SQL like being suggested, 'group by' needs to be applied on an unique id of every row from t1. &lt;/P&gt;&lt;P&gt;3. Data step, by using temporary array, mod() and/or&amp;nbsp; 'by' processing. Please search 'rolling' or 'moving' in the forum, you will see many posts with similar questions and answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Haikuo. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 18:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Monthly-rolling-average/m-p/96852#M27325</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-02-04T18:01:18Z</dc:date>
    </item>
  </channel>
</rss>

