<?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 minus sqrt calculation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/minus-sqrt-calculation/m-p/773096#M245535</link>
    <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have below derivation, can anyone help how can I implement this in sas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anyalamadugu_0-1633712952090.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64528i03CA845BDBA7A1B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anyalamadugu_0-1633712952090.png" alt="anyalamadugu_0-1633712952090.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Adithya&lt;/P&gt;</description>
    <pubDate>Fri, 08 Oct 2021 17:09:28 GMT</pubDate>
    <dc:creator>chinna0369</dc:creator>
    <dc:date>2021-10-08T17:09:28Z</dc:date>
    <item>
      <title>minus sqrt calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/minus-sqrt-calculation/m-p/773096#M245535</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have below derivation, can anyone help how can I implement this in sas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anyalamadugu_0-1633712952090.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64528i03CA845BDBA7A1B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anyalamadugu_0-1633712952090.png" alt="anyalamadugu_0-1633712952090.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Adithya&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 17:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/minus-sqrt-calculation/m-p/773096#M245535</guid>
      <dc:creator>chinna0369</dc:creator>
      <dc:date>2021-10-08T17:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: minus sqrt calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/minus-sqrt-calculation/m-p/773098#M245537</link>
      <description>&lt;P&gt;Depends on your data set up to some degree.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming you have a data set with SCR, AGE and SEX as variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if sex='Female' then eGFR = 194
                                                *(SCR**(1.094))
                                                 *(AGE**(-0.287))
                                                 *0.739;
else if sex = 'Male' then eGFR = 194
                                                *(SCR**(1.094))
                                                 *(AGE**(-0.287));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117414"&gt;@chinna0369&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have below derivation, can anyone help how can I implement this in sas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anyalamadugu_0-1633712952090.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64528i03CA845BDBA7A1B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anyalamadugu_0-1633712952090.png" alt="anyalamadugu_0-1633712952090.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Adithya&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 17:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/minus-sqrt-calculation/m-p/773098#M245537</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-08T17:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: minus sqrt calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/minus-sqrt-calculation/m-p/773134#M245545</link>
      <description>&lt;P&gt;I don't see a square root anywhere much less a negative one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS you use the ** operator to exponentiate a value:&lt;/P&gt;
&lt;PRE&gt;data example;
    x= 123;
   /* calculate x squared*/
    y= x**2;
    /* x to the minus 0.287 power*/
    z= x**(-0.287);
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Oct 2021 19:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/minus-sqrt-calculation/m-p/773134#M245545</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-08T19:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: minus sqrt calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/minus-sqrt-calculation/m-p/773176#M245568</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117414"&gt;@chinna0369&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I would like to point that negative numbers have no real square root.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Incidentally in solving your equation there is no need to calculate a square root.&lt;/P&gt;
&lt;P&gt;There are many approaches to solve your equations, I would prefer the following.&lt;/P&gt;
&lt;P&gt;I am first creating a user defined function. This function can be used like any other function.&lt;/P&gt;
&lt;P&gt;Then I have shown an example usage.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Creating function*/
proc fcmp outlib=work.userfuncs.mymath;
function egfr(gender, scr,age);
term1=194*input(&amp;amp;scr.,best12.)**(-1.094) *input(&amp;amp;Age.,best12.)**(-0.287);
if(upcase("&amp;amp;gender") eq "MALE")then factor=1;
 else factor=0.739;;
return (factor*term1);
endsub;&lt;BR /&gt;

/* Example usage*/&lt;BR /&gt;options cmplib=work.userfuncs;
data _null_;
Gender=female;
scr=100;
age=50;
egfr=egfr(gender,scr,age);
put egfr=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Oct 2021 01:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/minus-sqrt-calculation/m-p/773176#M245568</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-10-09T01:13:10Z</dc:date>
    </item>
  </channel>
</rss>

