<?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: How to aggregate value in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341730#M3356</link>
    <description>&lt;P&gt;Are you using IML?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My assumption is you're looking to calculate the cumulative value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, something as simple as:&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;retain cum_percent;
cum_percent = sum(cum_percent, &amp;nbsp;percent);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 Mar 2017 19:18:58 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-03-16T19:18:58Z</dc:date>
    <item>
      <title>How to aggregate value</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341727#M3354</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 dataset called A:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count | Percent&amp;nbsp;&lt;/P&gt;&lt;P&gt;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp;0.05&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp;0.15&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp;0.20&lt;/P&gt;&lt;P&gt;... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I obtain a dataset called B, where Cumulative Percentage for Count = 5 is the Percentage for Count &amp;lt;=&amp;nbsp;5:&lt;/P&gt;&lt;P&gt;(p(Count = 0) + p(Count = 2) + p(Count = 5) = 0.05 + 0.15 + 0.2 = 0.4)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count | Perenct | Cumulative Percent&lt;/P&gt;&lt;P&gt;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 0.05 &amp;nbsp; &amp;nbsp; | &amp;nbsp;0.05&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; 0.15 &amp;nbsp; &amp;nbsp; | &amp;nbsp;0.20&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; 0.20 &amp;nbsp; &amp;nbsp; | &amp;nbsp;0.40&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; &amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 19:06:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341727#M3354</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2017-03-16T19:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to aggregate value</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341729#M3355</link>
      <description>&lt;P&gt;Use the &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/68150/HTML/default/viewer.htm#imlug_langref_sect094.htm" target="_self"&gt;CUSUM function:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
percent = {0.05, 0.15, 0.2, 0.4, 0.2};
cusum = cusum(percent);
print percent cusum;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Mar 2017 19:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341729#M3355</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-03-16T19:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to aggregate value</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341730#M3356</link>
      <description>&lt;P&gt;Are you using IML?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My assumption is you're looking to calculate the cumulative value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, something as simple as:&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;retain cum_percent;
cum_percent = sum(cum_percent, &amp;nbsp;percent);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Mar 2017 19:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341730#M3356</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-16T19:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to aggregate value</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341735#M3357</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any kind of procedure if works would be great! And I just tried yours in a data step, and got what I have. Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 19:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341735#M3357</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2017-03-16T19:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to aggregate value</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341736#M3358</link>
      <description>&lt;P&gt;I'm not sure how you're calculating those numbers in the first place, but if using proc freq/means/tabulate you should be able to calculate the cumulative directly.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 19:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-aggregate-value/m-p/341736#M3358</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-16T19:29:55Z</dc:date>
    </item>
  </channel>
</rss>

