<?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: A bug in Computing Sum and Average PROC MEANS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493303#M72278</link>
    <description>&lt;P&gt;I expect your hitting floating point storage issues as the resulting number is very small:&lt;/P&gt;
&lt;P&gt;See &lt;A href="https://go.documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0ji1unv6thm0dn1gp4t01a1u0g6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;Numerical Accuracy in SAS Numbers&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just make sure you round values.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Sep 2018 11:54:19 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-09-07T11:54:19Z</dc:date>
    <item>
      <title>Precision issues with Computing Sum and Average PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493302#M72277</link>
      <description>&lt;P&gt;&lt;FONT color="#800080"&gt;Dear Members,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;I have encountered a problem while computing sum and mean in SAS for particularly a set of four numbers (0.3, -0.2, -0.1, 0). While I pass these numbers to Proc means the output gives sum as&amp;nbsp;-2.77556E-17 and mean as&amp;nbsp;-6.93889E-18.&amp;nbsp;While actually the sum should be zero and hence the mean should be zero. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;I have also tested with different order combination of above 4 numbers (there are 24 combination of arranging different order) where for some of the combination I am getting sum as -5.55112E-17 and mean as -1.38778E-17. The same problem occurs in Proc Summary, even tested with Proc GLM, PROC mixed, which gives different answers in LSmeans.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;But Proc Univariate gives the correct result with mean and sum as zero.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;If any one can give some insight what is happening with this four magic numbers. Also I have cross checked with Excel and R and facing the same problem for different&amp;nbsp;order combination of above 4 numbers.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;PS Attached PROC MEANS and PROC UNIVARIATE output for reference.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;Kind Regards,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;Rajesh kumar&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 11:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493302#M72277</guid>
      <dc:creator>rajclin</dc:creator>
      <dc:date>2018-09-07T11:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: A bug in Computing Sum and Average PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493303#M72278</link>
      <description>&lt;P&gt;I expect your hitting floating point storage issues as the resulting number is very small:&lt;/P&gt;
&lt;P&gt;See &lt;A href="https://go.documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0ji1unv6thm0dn1gp4t01a1u0g6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;Numerical Accuracy in SAS Numbers&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just make sure you round values.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 11:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493303#M72278</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-07T11:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: A bug in Computing Sum and Average PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493304#M72279</link>
      <description>&lt;P&gt;This is the typical artifact of the conversion of decimal fractions to binary. Do a google search for "SAS numerical precision", and you'll find ample information about what happens behind the scenes, and why it does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whenever you work with fractions in SAS, and you need to get a "clean" value for comparisons or such, use the round() function to get rid of the artifacts. Some procedures to that automatically (using "fuzz" factors), others need "manual" intervention.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that this is not specific to SAS, but happens in all software that uses real formats for numbers.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 08:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493304#M72279</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-09-07T08:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: A bug in Computing Sum and Average PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493352#M72281</link>
      <description>&lt;P&gt;Many thanks for your quick response!!!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 11:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493352#M72281</guid>
      <dc:creator>rajclin</dc:creator>
      <dc:date>2018-09-07T11:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: A bug in Computing Sum and Average PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493354#M72282</link>
      <description>Thank you for your detailed response!!!</description>
      <pubDate>Fri, 07 Sep 2018 11:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493354#M72282</guid>
      <dc:creator>rajclin</dc:creator>
      <dc:date>2018-09-07T11:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: A bug in Computing Sum and Average PROC MEANS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493356#M72283</link>
      <description>This link gives detailed information Thank you!!!</description>
      <pubDate>Fri, 07 Sep 2018 11:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Precision-issues-with-Computing-Sum-and-Average-PROC-MEANS/m-p/493356#M72283</guid>
      <dc:creator>rajclin</dc:creator>
      <dc:date>2018-09-07T11:18:08Z</dc:date>
    </item>
  </channel>
</rss>

