<?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 do Sigma Summation in SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130041#M35415</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use SUM statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum+3**i/fact(i)&amp;nbsp; ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 May 2013 08:53:39 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2013-05-06T08:53:39Z</dc:date>
    <item>
      <title>How to do Sigma Summation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130035#M35409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I was wondering if there was an easy way of doing a sigma summation of 1 to n in SAS?&lt;/P&gt;&lt;P&gt; I have been playing around with DO loops, but I would like to know if there is an easier way or a function I could take advantage of.&lt;/P&gt;&lt;P&gt; I am trying to calculate the sum going from i=0 to k of 3^i/i!&lt;/P&gt;&lt;P&gt; Could anyone let me know if there is a sigma summation function I could take advantage of?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 May 2013 15:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130035#M35409</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2013-05-05T15:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Sigma Summation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130036#M35410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I have gotten so far that works the way that I want it to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test3;&lt;/P&gt;&lt;P&gt; do i =0 to 10 by 1;&lt;/P&gt;&lt;P&gt; n=sum(3**i/fact(i));&lt;/P&gt;&lt;P&gt;if first.i then cumsum=n;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else cumsum+n;&lt;/P&gt;&lt;P&gt; output;&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=test3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has any other suggestions, please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 May 2013 16:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130036#M35410</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2013-05-05T16:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Sigma Summation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130037#M35411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Does this note in the SAS Log concern you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;NOTE: Variable first.i is uninitialized.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 May 2013 19:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130037#M35411</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-05-05T19:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Sigma Summation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130038#M35412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, I didn't even look at the log. Should I just initialize my i before the DO loop?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 May 2013 21:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130038#M35412</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2013-05-05T21:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Sigma Summation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130039#M35413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i is intialised in the do loop, I don't think you can use first.i in the context you are trying.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 00:28:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130039#M35413</guid>
      <dc:creator>twocanbazza</dc:creator>
      <dc:date>2013-05-06T00:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Sigma Summation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130040#M35414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SUM function is useful mostly when there are many arguments.&amp;nbsp; You can take advantage of the fact that&lt;STRONG&gt; c = sum(a,b)&lt;/STRONG&gt; will yield a number whereas &lt;STRONG&gt;c = a + b&lt;/STRONG&gt; will assing a missing value to c if a or b is missing.&lt;STRONG&gt; First.i&lt;/STRONG&gt; would mean something to SAS only if there was a &lt;STRONG&gt;BY i&lt;/STRONG&gt; statement in your datastep. &lt;STRONG&gt;First.i&lt;/STRONG&gt; would take the value &lt;STRONG&gt;TRUE&lt;/STRONG&gt; each time&lt;STRONG&gt; i&lt;/STRONG&gt; changes value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The proper symtax would be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;data test3;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;do i = 0 to 10 by 1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cumSum = sum(cumSum, 3**i/fact(i));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;proc print data=test3;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;id i;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 00:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130040#M35414</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-06T00:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Sigma Summation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130041#M35415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use SUM statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum+3**i/fact(i)&amp;nbsp; ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 08:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-do-Sigma-Summation-in-SAS/m-p/130041#M35415</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-05-06T08:53:39Z</dc:date>
    </item>
  </channel>
</rss>

