<?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: SAS formula with logs not giving correct values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576195#M163064</link>
    <description>&lt;P&gt;I think your expression should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LiverFat_P = 10**(-0.805 + (0.282*MetS) + (0.078*T2DM) + (0.525*LINS1) + (0.521*LAST1) - (0.454*LASTdALT));&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2019 15:09:42 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2019-07-24T15:09:42Z</dc:date>
    <item>
      <title>SAS formula with logs not giving correct values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576155#M163047</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to put this Excel formula into SAS version 9.4 =POWER(10,-0.805+0.282*B4+0.078*B5+0.525*LOG(B6,10)+0.521*LOG(B7,10)-0.454*LOG((B7/B8),10))&lt;/P&gt;&lt;P&gt;In Excel I get percents ranging from 0.51 to 32.67 which make sense. However in SAS I get values ranging from 1.34242E-21 to 110.7295.&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have written in a SAS data step&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LINS1 = log10(INS1); 
LAST1 = log10(AST1); 
LASTdALT = log10(AST1/ALT1);

LiverFat_P = (-0.805 + (0.282*MetS) + (0.078*T2DM) + (0.525*LINS1) + (0.521*LAST1) - (0.454*LASTdALT))**10;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my log I get a note saying division by 0 issues were detected at this formula and these values were set to missing, but no other apparent issues. Any ideas on what's going on and how to fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 13:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576155#M163047</guid>
      <dc:creator>Asek</dc:creator>
      <dc:date>2019-07-24T13:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS formula with logs not giving correct values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576157#M163048</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282574"&gt;@Asek&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This is what I have written in a SAS data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LINS1 = log10(INS1); 
LAST1 = log10(AST1); 
LASTdALT = log10(AST1/ALT1);

LiverFat_P = (-0.805 + (0.282*MetS) + (0.078*T2DM) + (0.525*LINS1) + (0.521*LAST1) - (0.454*LASTdALT))**10;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my log I get a note saying division by 0 issues were detected at this formula and these values were set to missing, but no other apparent issues. Any ideas on what's going on and how to fix it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please actually look at the data in your SAS data set (not in Excel) to see if there are actual zeros in a denominator. Let us know what you find.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 13:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576157#M163048</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-24T13:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS formula with logs not giving correct values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576174#M163054</link>
      <description>&lt;P&gt;Thank you for the suggestion Paige. There was one 0 and I set it to missing. This removes the "division by 0" note from my log but does not solve the issue of the wrong values I'm getting. They are still the same.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 14:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576174#M163054</guid>
      <dc:creator>Asek</dc:creator>
      <dc:date>2019-07-24T14:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS formula with logs not giving correct values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576176#M163055</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you need to continue simple debugging steps. Does B4 map to MetS? Are the data values in Excel the same as in SAS? &lt;EM&gt;etc.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 14:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576176#M163055</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-24T14:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS formula with logs not giving correct values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576192#M163062</link>
      <description>&lt;P&gt;I spent hours checking everything I could think of yesterday - including checking that the data in the individual observations where I was getting wrong SAS values was the same in SAS and Excel (it is). I'm hoping for additional ideas of what to check. I'm wondering whether it's related to decimal places used in the calculation?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 15:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576192#M163062</guid>
      <dc:creator>Asek</dc:creator>
      <dc:date>2019-07-24T15:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS formula with logs not giving correct values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576195#M163064</link>
      <description>&lt;P&gt;I think your expression should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LiverFat_P = 10**(-0.805 + (0.282*MetS) + (0.078*T2DM) + (0.525*LINS1) + (0.521*LAST1) - (0.454*LASTdALT));&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 15:09:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576195#M163064</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-07-24T15:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS formula with logs not giving correct values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576202#M163067</link>
      <description>&lt;P&gt;Yes, that worked. Thank you! I knew it was going to be something simple.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 15:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-formula-with-logs-not-giving-correct-values/m-p/576202#M163067</guid>
      <dc:creator>Asek</dc:creator>
      <dc:date>2019-07-24T15:21:33Z</dc:date>
    </item>
  </channel>
</rss>

