<?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 expand to calculate moving avg exlcuding current data point in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-expand-to-calculate-moving-avg-exlcuding-current-data-point/m-p/616085#M77022</link>
    <description>&lt;P&gt;Do you have daily observations? Weekly? To better assist, please provide sample data in a data step.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jan 2020 22:24:31 GMT</pubDate>
    <dc:creator>unison</dc:creator>
    <dc:date>2020-01-08T22:24:31Z</dc:date>
    <item>
      <title>proc expand to calculate moving avg exlcuding current data point</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-expand-to-calculate-moving-avg-exlcuding-current-data-point/m-p/616074#M77021</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using proc expand to calculate moving average for 12 weeks of data. But my requirement is to calculate moving average for 12 weeks (excluding current week) and compare that with current week. Is there any way to achieve that using proc expand?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I want to calculate moving avg for 12 weeks excluding current week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc expand data=alerttable out=base_y method=none factor=(1:11);
   id weekstart;
   by strategynm;
   convert weekcount=MovAv30  / transformout=(movave 12);
   convert weekcount=CurrVal  / transformout=(movave 01);
   convert weekcount=Std      / transformout=(movstd 12); 
   convert weekcount=PreVal	  / transformout=(lag 1);
   convert weekcount=pctdiff  / transformout=(PCTDIF);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 21:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-expand-to-calculate-moving-avg-exlcuding-current-data-point/m-p/616074#M77021</guid>
      <dc:creator>a_khedekar</dc:creator>
      <dc:date>2020-01-08T21:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: proc expand to calculate moving avg exlcuding current data point</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-expand-to-calculate-moving-avg-exlcuding-current-data-point/m-p/616085#M77022</link>
      <description>&lt;P&gt;Do you have daily observations? Weekly? To better assist, please provide sample data in a data step.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 22:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-expand-to-calculate-moving-avg-exlcuding-current-data-point/m-p/616085#M77022</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-01-08T22:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc expand to calculate moving avg exlcuding current data point</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-expand-to-calculate-moving-avg-exlcuding-current-data-point/m-p/616194#M77027</link>
      <description>&lt;P&gt;Observations are weekly with weekcount for each week.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 14:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-expand-to-calculate-moving-avg-exlcuding-current-data-point/m-p/616194#M77027</guid>
      <dc:creator>a_khedekar</dc:creator>
      <dc:date>2020-01-09T14:04:30Z</dc:date>
    </item>
  </channel>
</rss>

