<?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 PROC EXPAND in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-EXPAND/m-p/610890#M177987</link>
    <description>&lt;P&gt;The following code computes the cumulative returns of the variable &lt;EM&gt;return&lt;/EM&gt; below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data return;
t=_n_;
input return @@;
cards;
0.01 0.02 0.03 0.04 0.05 0.06 . 0.08 0.09 0.1
;
run;
proc expand out=return;
id t;
convert return=cumulative/transformout=(+1 nomiss movprod 3 -1 trimleft 2);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To skip any missing observation, I put &lt;EM&gt;nomiss&lt;/EM&gt; above to have the 7-9th &lt;EM&gt;cumulative&lt;/EM&gt; observations missing.&lt;/P&gt;&lt;PRE&gt; t    cumulative    return

 1       .           0.01
 2       .           0.02
 3      0.06111      0.03
 4      0.09262      0.04
 5      0.12476      0.05
 6      0.15752      0.06
 7      0.19091       .
 8      0.22494      0.08
 9      0.25960      0.09
10      0.29492      0.10&lt;/PRE&gt;&lt;P&gt;(1) What is the problem with the &lt;EM&gt;nomiss&lt;/EM&gt; above? It seems the &lt;EM&gt;nomiss&lt;/EM&gt; should skip converting due to the missing. (2) Why the 7th, 8th, and 9th &lt;EM&gt;cumulative&lt;/EM&gt; observations are 0.19091, 0.22494, and 0.25960, respectively? I can compute the 6th (1.04*1.05*1.06-1) and 10th (1.08*1.09*1.1-1) observations, but the 7th to 9th observations are unclear. Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2019 03:08:52 GMT</pubDate>
    <dc:creator>Junyong</dc:creator>
    <dc:date>2019-12-11T03:08:52Z</dc:date>
    <item>
      <title>PROC EXPAND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-EXPAND/m-p/610890#M177987</link>
      <description>&lt;P&gt;The following code computes the cumulative returns of the variable &lt;EM&gt;return&lt;/EM&gt; below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data return;
t=_n_;
input return @@;
cards;
0.01 0.02 0.03 0.04 0.05 0.06 . 0.08 0.09 0.1
;
run;
proc expand out=return;
id t;
convert return=cumulative/transformout=(+1 nomiss movprod 3 -1 trimleft 2);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To skip any missing observation, I put &lt;EM&gt;nomiss&lt;/EM&gt; above to have the 7-9th &lt;EM&gt;cumulative&lt;/EM&gt; observations missing.&lt;/P&gt;&lt;PRE&gt; t    cumulative    return

 1       .           0.01
 2       .           0.02
 3      0.06111      0.03
 4      0.09262      0.04
 5      0.12476      0.05
 6      0.15752      0.06
 7      0.19091       .
 8      0.22494      0.08
 9      0.25960      0.09
10      0.29492      0.10&lt;/PRE&gt;&lt;P&gt;(1) What is the problem with the &lt;EM&gt;nomiss&lt;/EM&gt; above? It seems the &lt;EM&gt;nomiss&lt;/EM&gt; should skip converting due to the missing. (2) Why the 7th, 8th, and 9th &lt;EM&gt;cumulative&lt;/EM&gt; observations are 0.19091, 0.22494, and 0.25960, respectively? I can compute the 6th (1.04*1.05*1.06-1) and 10th (1.08*1.09*1.1-1) observations, but the 7th to 9th observations are unclear. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 03:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-EXPAND/m-p/610890#M177987</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2019-12-11T03:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC EXPAND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-EXPAND/m-p/610893#M177988</link>
      <description>&lt;P&gt;It seems EXPAND by default (METHOD=SPLINE) alters the missing as 0.07 and then compute &lt;EM&gt;cumulative&lt;/EM&gt;. METHOD=NONE prevents this.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 03:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-EXPAND/m-p/610893#M177988</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2019-12-11T03:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC EXPAND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-EXPAND/m-p/610909#M177997</link>
      <description>&lt;P&gt;A small change will give you what you want. Add method=none to the Proc Expand Statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc expand out=return method=none;
id t;
convert return=cumulative/transformout=(+1 nomiss movprod 3 -1 trimleft 2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: I see you figured it out on your own already &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 07:24:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-EXPAND/m-p/610909#M177997</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-12-11T07:24:19Z</dc:date>
    </item>
  </channel>
</rss>

