<?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: Cumulative past monthly returns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420393#M280631</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data Want (Drop = MyCumSum_dummy);
  Retain MyCumSum_dummy Nr;
  Set have;
  By PERMNO;
  If First.PERMNO Then Nr = 0;
  Nr + 1;
  MyCumSum_dummy = Sum(MyCumSum_dummy, Lag2(Ret), IfN(Nr &amp;gt;= 12, -Lag13(Ret), 0));
  MyCumSum = IfN(Nr &amp;gt;= 12, MyCumSum_dummy, .);
Run;

* OR;
Proc TimeData Data = have
              Out = _NULL_
			  OutArray = want2;
  By PERMNO;
  ID Date Interval = MONTH;
  Var Ret;
  OutArray MyCumSum;
  Do t = 1 To _LENGTH_;
    MyCumSum[t] = Ret[t-12]+Ret[t-11]+Ret[t-10]+Ret[t-9]+
                  Ret[t-8]+Ret[t-7]+Ret[t-6]+Ret[t-5]+
                  Ret[t-4]+Ret[t-3]+Ret[t-2];
  End;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Dec 2017 09:09:24 GMT</pubDate>
    <dc:creator>user24feb</dc:creator>
    <dc:date>2017-12-12T09:09:24Z</dc:date>
    <item>
      <title>Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420363#M280627</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set with monthly returns for about 4000 different firms. I want to create a new column with "cumulative past returns from month t – 12 to t − 2" for each firm separately, excluding the most recent one i.e. "&lt;SPAN&gt;t − 1&lt;/SPAN&gt;". Here firm is identified by PERMNO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please guide me how to take cumulative lag (t-12, t-2) by firm?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See a sample of my data set below. Thanks.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input Date: mmddyy10. PERMNO Ret;
format Date mmddyy10.;
datalines;
01/31/2001    21227    -0.03
02/28/2001    21227    -0.06
03/31/2001    21227    -0.04
04/30/2001    21227    0.04
05/31/2001    21227    0.12
06/30/2001    21227    -0.08
07/31/2001    21227    0.12
08/31/2001    21227    0.02
09/30/2001    21227    0.11
10/31/2001    21227    0.17
11/30/2001    21227    -0.11
12/31/2001    21227    -0.04
01/31/2002    21227    -0.2
02/28/2002    21227    0.11
03/31/2002    21227    -0.06
04/30/2002    21227    -0.03
06/30/2005    22100    -0.01
07/31/2005    22100    0.02
08/31/2005    22100    0.09
09/30/2005    22100    0.006
10/31/2005    22100    -0.07
11/30/2005    22100    0.06
12/31/2005    22100    0.09
01/31/2006    22100    0.07
02/28/2006    22100    -0.15
03/31/2006    22100    0.05
04/30/2006    22100    0.08
05/31/2006    22100    -0.01
06/30/2006    22100    -0.02
07/31/2006    22100    -0.14
08/31/2006    22100    -0.10
09/30/2006    22100    0.007
10/31/2006    22100    0.05
11/30/2006    22100    0.06
12/31/2006    22100    0.12
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Dec 2017 23:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420363#M280627</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-12-13T23:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420367#M280628</link>
      <description>could not under stand "month t – 12 to t − 2" can you be more clear&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Dec 2017 05:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420367#M280628</guid>
      <dc:creator>RM6</dc:creator>
      <dc:date>2017-12-12T05:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420377#M280629</link>
      <description>&lt;P&gt;Two questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why do you want&amp;nbsp;&lt;SPAN&gt;Cumulative past monthly returns from time t-12 to t-2 at time t? Seems counter intuitive to me?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you have SAS/ETS? If so, PROC EXPAND might be worth looking into &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 06:50:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420377#M280629</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-12-12T06:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420393#M280631</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data Want (Drop = MyCumSum_dummy);
  Retain MyCumSum_dummy Nr;
  Set have;
  By PERMNO;
  If First.PERMNO Then Nr = 0;
  Nr + 1;
  MyCumSum_dummy = Sum(MyCumSum_dummy, Lag2(Ret), IfN(Nr &amp;gt;= 12, -Lag13(Ret), 0));
  MyCumSum = IfN(Nr &amp;gt;= 12, MyCumSum_dummy, .);
Run;

* OR;
Proc TimeData Data = have
              Out = _NULL_
			  OutArray = want2;
  By PERMNO;
  ID Date Interval = MONTH;
  Var Ret;
  OutArray MyCumSum;
  Do t = 1 To _LENGTH_;
    MyCumSum[t] = Ret[t-12]+Ret[t-11]+Ret[t-10]+Ret[t-9]+
                  Ret[t-8]+Ret[t-7]+Ret[t-6]+Ret[t-5]+
                  Ret[t-4]+Ret[t-3]+Ret[t-2];
  End;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2017 09:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420393#M280631</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2017-12-12T09:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420428#M280632</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/166516"&gt;@Saba1&lt;/a&gt;&lt;BR /&gt;What is your formula for cululative return?</description>
      <pubDate>Tue, 12 Dec 2017 11:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420428#M280632</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2017-12-12T11:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420438#M280633</link>
      <description>&lt;P&gt;When doing rolling sums/means, the easiest is often to put the values in a temporary array. Only here we have to use LAG because we do not want the newest values in:&lt;/P&gt;&lt;PRE&gt;data want;
  array values (0:10) 8 _temporary_;
  call missing(of values(*));
  do _N_=0 by 1 until(last.permno);
    set have;
    by permno;
    sum=sum(of values(*));
    output;
    values(mod(_N_,11))=ifn(_N_=0,.,lag(Ret)); /* use IFN so that LAG is always called */
    end;
run;&lt;/PRE&gt;&lt;P&gt;If you do not want the sum before you have all 11 values, use "if _N_&amp;gt;=10 then sum=sum(of values(*));"&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 12:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420438#M280633</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2017-12-12T12:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420442#M280634</link>
      <description>Inside a DO loop like that, a sneeky trick to work with lags without using the current value is to execute the SET after the calculation (not before)</description>
      <pubDate>Tue, 12 Dec 2017 12:40:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420442#M280634</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2017-12-12T12:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420447#M280635</link>
      <description>&lt;P&gt;If I understand what you mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input Date: mmddyy10. PERMNO Ret;
format Date mmddyy10.;
datalines;
01/31/2001    21227    -0.03
02/28/2001    21227    -0.06
03/31/2001    21227    -0.04
04/30/2001    21227    0.04
05/31/2001    21227    0.12
06/30/2001    21227    -0.08
07/31/2001    21227    0.12
08/31/2001    21227    0.02
09/30/2001    21227    0.11
10/31/2001    21227    0.17
11/30/2001    21227    -0.11
12/31/2001    21227    -0.04
01/31/2002    21227    -0.2
02/28/2002    21227    0.11
03/31/2002    21227    -0.06
04/30/2002    21227    -0.03
06/30/2005    22100    -0.01
07/31/2005    22100    0.02
08/31/2005    22100    0.09
09/30/2005    22100    0.006
10/31/2005    22100    -0.07
11/30/2005    22100    0.06
12/31/2005    22100    0.09
01/31/2006    22100    0.07
02/28/2006    22100    -0.15
03/31/2006    22100    0.05
04/30/2006    22100    0.08
05/31/2006    22100    -0.01
06/30/2006    22100    -0.02
07/31/2006    22100    -0.14
08/31/2006    22100    -0.10
09/30/2006    22100    0.007
10/31/2006    22100    0.05
11/30/2006    22100    0.06
12/31/2006    22100    0.12 
;
run;
proc sql;
create table want as
 select *,(select sum(ret) from have where PERMNO=a.PERMNO and
 Date between intnx('month',a.date,-12,'e') and intnx('month',a.date,-2,'e')) as sum
  from have as a;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2017 12:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420447#M280635</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-12-12T12:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420456#M280636</link>
      <description>&lt;P&gt;For each t, you want rolling window returns,&amp;nbsp; where the window size is 11 months, and the window end-point is t-2.&amp;nbsp;&amp;nbsp; Keep a rolling window of the sum of the log(ret+1) for lagged returns,,, and then just exp that sum to get cumulative returns:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input Date: mmddyy10. PERMNO Ret;
format Date mmddyy10.;
datalines;
01/31/2001    21227    -0.03
02/28/2001    21227    -0.06
03/31/2001    21227    -0.04
04/30/2001    21227    0.04
05/31/2001    21227    0.12
06/30/2001    21227    -0.08
07/31/2001    21227    0.12
08/31/2001    21227    0.02
09/30/2001    21227    0.11
10/31/2001    21227    0.17
11/30/2001    21227    -0.11
12/31/2001    21227    -0.04
01/31/2002    21227    -0.2
02/28/2002    21227    0.11
03/31/2002    21227    -0.06
04/30/2002    21227    -0.03
06/30/2005    22100    -0.01
07/31/2005    22100    0.02
08/31/2005    22100    0.09
09/30/2005    22100    0.006
10/31/2005    22100    -0.07
11/30/2005    22100    0.06
12/31/2005    22100    0.09
01/31/2006    22100    0.07
02/28/2006    22100    -0.15
03/31/2006    22100    0.05
04/30/2006    22100    0.08
05/31/2006    22100    -0.01
06/30/2006    22100    -0.02
07/31/2006    22100    -0.14
08/31/2006    22100    -0.10
09/30/2006    22100    0.007
10/31/2006    22100    0.05
11/30/2006    22100    0.06
12/31/2006    22100    0.12
run;
data want (drop=_:);
  set have ;
  by permno;
  _month+1;
  if first.permno then _month=1;

  _logret=log(1+ret);
  _sumlog+lag2(_logret);
  _sumlog=_sumlog -ifn(_n_&amp;gt;12,0,lag12(_logret));

  if _month&amp;gt;12 then window_12_2_ret=exp(_sumlog)-1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The &lt;EM&gt;&lt;STRONG&gt;_sumlog=_sumlog-ifn(_n_&amp;gt;12,0,lag12(_logret)&lt;/STRONG&gt;&lt;/EM&gt; statement uses the IFN function, which unconditional updates the &lt;EM&gt;&lt;STRONG&gt;lag12(_logret)&lt;/STRONG&gt;&lt;/EM&gt; queue, but conditionally&amp;nbsp; returns it value.&amp;nbsp; Speciificlly the value is returned only starting at the 13th overall observation in dataset HAVE.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Use _month to determine how advanced &lt;EM&gt;&lt;STRONG&gt;within each pemno&lt;/STRONG&gt;&lt;/EM&gt; a record is.&amp;nbsp; Note the variable WINDOW_12_2_RET is only set when the rolling windows are completely populated.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 12 Dec 2017 13:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/420456#M280636</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-12-12T13:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/421036#M280637</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/179384"&gt;@RM6&lt;/a&gt;&amp;nbsp;To run a regression, I need to control for past returns. One of the controls is "past year return" and literature uses "lag t-12, lag t-2" for this variable. This means "cumulative return of past 11 months excluding the most recent month".&amp;nbsp; Hope it clarifies.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 23:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/421036#M280637</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-12-13T23:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/421038#M280638</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&lt;/P&gt;&lt;P&gt;1- I need to measure&lt;SPAN&gt;&amp;nbsp;"past year return" and literature uses "lag t-12, lag t-2" for this variable. This means "cumulative return of&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;past 11 months excluding the most recent month".&amp;nbsp;Cumulative t-12,t-2 is the sum of lag-returns from lag 2 to lag 12.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2- Yes, I do have SAS/ETS.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 23:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/421038#M280638</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-12-13T23:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative past monthly returns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/421040#M280639</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15174"&gt;@Peter_C&lt;/a&gt;&amp;nbsp;I need to use something like&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;12&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;11&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;10&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;9&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;
                  Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;8&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;7&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;6&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;5&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;
                  Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;4&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;Ret&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;t&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where "t-n" are lags. But the problem is that I need to keep rolling it for each month "t" by PERMNO.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 23:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cumulative-past-monthly-returns/m-p/421040#M280639</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-12-13T23:55:45Z</dc:date>
    </item>
  </channel>
</rss>

