<?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: Iterative sum with factorial  factors in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165646#M42925</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I would first check that all your variables are numeric (I suspect this is your problem).&amp;nbsp; Buy, sell and pt.&amp;nbsp; If not then you are passing a character to a function which is requiring a numeric.&amp;nbsp; I would also re-iterate to break the formula up so you have a bit more clarity of what is going on (this works for me), like:&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;&amp;nbsp; attrib Buy Sell Pt format=best.; &lt;BR /&gt;&amp;nbsp; buy=3; sell=4; pt=27865; output;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; buy=8; sell=10; pt=678783; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;&amp;nbsp; set have;&lt;BR /&gt;&amp;nbsp; bs=buy + sell;&lt;BR /&gt;&amp;nbsp; right=0;&lt;BR /&gt;&amp;nbsp; do i=0 to bs;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; calc1=(fact(bs) / (fact(i) + fact(bs-i)));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; calc2=calc1 * (i/(bs)) * ((1-Pt)**(bs-i)) * abs((i/(bs)-Pt));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; right=calc2 + right;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jul 2014 12:49:01 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-07-03T12:49:01Z</dc:date>
    <item>
      <title>Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165643#M42922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing an&amp;nbsp; issue when doing an itrative sum using factorials. This is the first time I use both an iterative sum and the FACT function so I guess there are a&amp;nbsp; lot of things wrong in my code.&lt;/P&gt;&lt;P&gt;Want I want is the formula I hereby attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it its:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data lsv.right;&lt;/P&gt;&lt;P&gt;set lsv.left;&lt;/P&gt;&lt;P&gt;do i=0 to i=(buy+sell);&lt;/P&gt;&lt;P&gt;right = ((fact(buy+sell)/ (fact(i)+fact(Buy+sell-i)))*(i/(buy+sell))*((1-Pt)**(Buy+sell-i))*abs((i/(buy+sell)-Pt)))+ right;&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;Here is a sample of data I have. BUy and sell are integers.&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="320"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="80"&gt;Buy&lt;/TD&gt;&lt;TD width="80"&gt;Sell&lt;/TD&gt;&lt;TD width="80"&gt;Pt&lt;/TD&gt;&lt;TD width="80"&gt;Right&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;TD align="right"&gt;2,7865&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;8&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;TD align="right"&gt;6,78783&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me with it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11210i172D01A6F2BFAC76/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="formula.PNG" title="formula.PNG" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 09:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165643#M42922</guid>
      <dc:creator>crikriek</dc:creator>
      <dc:date>2014-07-03T09:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165644#M42923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what is the problem with it, is it giving an Error/Warning or not giving you the result you expect.&amp;nbsp; If you are not getting the result you expect then break the formula down into parts, e.g.:&lt;/P&gt;&lt;P&gt;data ...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp1=fact(buy+sell);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp2=temp1 /....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is error/warning then post the log.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 10:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165644#M42923</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-03T10:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165645#M42924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the log error message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function FACT at line 36 column 11.&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function FACT at line 36 column 36.&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function FACT at line 36 column 11.&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function FACT at line 36 column 36.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 10:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165645#M42924</guid>
      <dc:creator>crikriek</dc:creator>
      <dc:date>2014-07-03T10:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165646#M42925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I would first check that all your variables are numeric (I suspect this is your problem).&amp;nbsp; Buy, sell and pt.&amp;nbsp; If not then you are passing a character to a function which is requiring a numeric.&amp;nbsp; I would also re-iterate to break the formula up so you have a bit more clarity of what is going on (this works for me), like:&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;&amp;nbsp; attrib Buy Sell Pt format=best.; &lt;BR /&gt;&amp;nbsp; buy=3; sell=4; pt=27865; output;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; buy=8; sell=10; pt=678783; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;&amp;nbsp; set have;&lt;BR /&gt;&amp;nbsp; bs=buy + sell;&lt;BR /&gt;&amp;nbsp; right=0;&lt;BR /&gt;&amp;nbsp; do i=0 to bs;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; calc1=(fact(bs) / (fact(i) + fact(bs-i)));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; calc2=calc1 * (i/(bs)) * ((1-Pt)**(bs-i)) * abs((i/(bs)-Pt));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; right=calc2 + right;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 12:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165646#M42925</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-03T12:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165647#M42926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wild guess, that 'buy' and/or 'sell' are character variables in dataset lsv.left as mentioned by &lt;A __default_attr="814511" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;, judging by the location in the line for these NOTEs..&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may wish to consider reparameterizing and using LFACT (log of the factorial) in order to avoid a noncomputable result for moderately large arguments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 12:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165647#M42926</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-07-03T12:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165648#M42927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used your code and I made sure that I treat with numeric variables. I create a num variable n that is the sum of buy and sell. But it still shows the same log error &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; alter table lsv.left &lt;/P&gt;&lt;P&gt;&amp;nbsp; add n num label='n';&lt;/P&gt;&lt;P&gt;&amp;nbsp; Proc SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; update lsv.left&lt;/P&gt;&lt;P&gt;&amp;nbsp; set n=buy+sell;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data&amp;nbsp; lsv.right;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set lsv.left;&lt;/P&gt;&lt;P&gt;&amp;nbsp; right=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=0 to i=n;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; calc1=(fact(n) / (fact(i) * fact(n-i)));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; calc2=calc1 * (i/(n)) * ((1-Pt)**(n-i)) * abs((i/(n)-Pt));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; right=calc2 + right;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 13:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165648#M42927</guid>
      <dc:creator>crikriek</dc:creator>
      <dc:date>2014-07-03T13:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165649#M42928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your code you have:&lt;/P&gt;&lt;P&gt;do I=0 to I=n;&lt;/P&gt;&lt;P&gt;This is incorrect, you want a range, so I=0 to n;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 13:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165649#M42928</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-03T13:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165650#M42929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, I corrected it and nows the log error message becomes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invalid DO loop control information, either the INITIAL or TO expression is missing or the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BY expression is missing, zero, or invalid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 13:24:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165650#M42929</guid>
      <dc:creator>crikriek</dc:creator>
      <dc:date>2014-07-03T13:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165651#M42930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check what N in lsv.left as it sound like that is not being create properly.&amp;nbsp;&amp;nbsp; So do this:&lt;/P&gt;&lt;P&gt;Run the first SQL statement, check the lsv.left.&amp;nbsp; Does this look correct.&lt;/P&gt;&lt;P&gt;Run the second SQL statement, check the lsv.left table looks correct. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 13:36:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165651#M42930</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-03T13:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165652#M42931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did it and there actually was a problem. The fact is that n was worth '.' when there were a buy or sell =0. So I corrected it this way&lt;/P&gt;&lt;P&gt;Proc SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; update lsv.left&lt;/P&gt;&lt;P&gt;&amp;nbsp; set n=buy where sell=.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Proc SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Update lsv.left&lt;/P&gt;&lt;P&gt;&amp;nbsp; set n=sell where buy=.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I still have the same error message&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 13:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165652#M42931</guid>
      <dc:creator>crikriek</dc:creator>
      <dc:date>2014-07-03T13:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165653#M42932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post some test data of lsv.left after the two proc sql statements have run.&amp;nbsp; I suspect you still have a . or missing in your data i.e. what happens if &lt;STRONG&gt;both &lt;/STRONG&gt;buy and sell are missing, then that row should be removed as the procedures cannot work on that data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 13:50:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165653#M42932</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-03T13:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165654#M42933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe get rid of the SQL part and just add a clause in your datastep:&lt;/P&gt;&lt;P&gt;data lsv.right;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set lsv.left;&lt;/P&gt;&lt;P&gt;&amp;nbsp; right=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if buy ne . or sell ne . then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if buy=. then n=sell;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else n=buy;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=0 to i=n;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calc1=(fact(n) / (fact(i) * fact(n-i)));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calc2=calc1 * (i/(n)) * ((1-Pt)**(n-i)) * abs((i/(n)-Pt));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right=calc2 + right;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 13:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165654#M42933</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-03T13:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165655#M42934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot ! YOu were right. One row had both sell and buy equal to .&lt;/P&gt;&lt;P&gt;i deleted it and now it's working, thanks a lot ! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 13:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165655#M42934</guid>
      <dc:creator>crikriek</dc:creator>
      <dc:date>2014-07-03T13:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165656#M42935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Unfortunately i'm still facing an issue I can't solve; The value I otain for right is&amp;nbsp; always &amp;gt;1 and sometimes superhigh. In actual facts this formula always lead to a result &amp;lt;1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; FYI: the input Pt is always around 0,5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have an idea of the problem in the code ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 18:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165656#M42935</guid>
      <dc:creator>crikriek</dc:creator>
      <dc:date>2014-07-03T18:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165657#M42936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, am a code monkey not a stato, its all greek to me.&amp;nbsp; Maybe post a question in the stats section.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2014 07:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165657#M42936</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-04T07:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165658#M42937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks i'll do that &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2014 07:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165658#M42937</guid>
      <dc:creator>crikriek</dc:creator>
      <dc:date>2014-07-04T07:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165659#M42938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like there may be a discrepancy in coding from a text formula, as I get super large values as well, with the test data.&amp;nbsp; Can you post a link to the formula?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 14:58:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165659#M42938</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-07-09T14:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165660#M42939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One thing is to initialize Right to 0 before the loop. If you have x+y and y is missing then the sum result will be missing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 15:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165660#M42939</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-07-09T15:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165661#M42940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still get huge numbers.&amp;nbsp; I think the code for the formula needs checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 15:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165661#M42940</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-07-09T15:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative sum with factorial  factors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165662#M42941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone ! &lt;/P&gt;&lt;P&gt;I'm using the same formula on another database and I think I'm having the following probelm : THe number i cannot go higher than 1030. He writes an error message when nit is higher than 1030. Do you know about that ? Is&amp;nbsp; there a way to solve it ? Thanks&lt;/P&gt;&lt;P&gt;The code:&lt;/P&gt;&lt;P&gt;Data database.lsvstock3;&lt;/P&gt;&lt;P&gt;set database.lsvstock2;&lt;/P&gt;&lt;P&gt;Af=0;&lt;/P&gt;&lt;P&gt;do i=0 to nit;&lt;/P&gt;&lt;P&gt;AF = comb(nit,i)*(Pt**i)*((1-Pt)**(nit-i))*abs((i/nit)-Pt)+AF;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;The log error message:&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function COMB at line 570 column 6.&lt;/P&gt;&lt;P&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 205291 at 570:17&amp;nbsp;&amp;nbsp; 20144 at 570:59&lt;/P&gt;&lt;P&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; operations have been set to missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 205291 at 570:6&lt;/P&gt;&lt;P&gt;NOTE: There were 170 observations read from the data set DATABASE.LSVSTOCK2.&lt;/P&gt;&lt;P&gt;NOTE: The data set DATABASE.LSVSTOCK3 has 170 observations and 11 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.24 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.21 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 12:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Iterative-sum-with-factorial-factors/m-p/165662#M42941</guid>
      <dc:creator>crikriek</dc:creator>
      <dc:date>2014-07-16T12:59:15Z</dc:date>
    </item>
  </channel>
</rss>

