Hi all,
I have below derivation, can anyone help how can I implement this in sas?
Thanks,
Adithya
Depends on your data set up to some degree.
Assuming you have a data set with SCR, AGE and SEX as variables.
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));
@chinna0369 wrote:
Hi all,
I have below derivation, can anyone help how can I implement this in sas?
Thanks,
Adithya
I don't see a square root anywhere much less a negative one.
In SAS you use the ** operator to exponentiate a value:
data example; x= 123; /* calculate x squared*/ y= x**2; /* x to the minus 0.287 power*/ z= x**(-0.287); run;
Hello @chinna0369
I would like to point that negative numbers have no real square root.
Incidentally in solving your equation there is no need to calculate a square root.
There are many approaches to solve your equations, I would prefer the following.
I am first creating a user defined function. This function can be used like any other function.
Then I have shown an example usage.
/* Creating function*/
proc fcmp outlib=work.userfuncs.mymath;
function egfr(gender, scr,age);
term1=194*input(&scr.,best12.)**(-1.094) *input(&Age.,best12.)**(-0.287);
if(upcase("&gender") eq "MALE")then factor=1;
else factor=0.739;;
return (factor*term1);
endsub;
/* Example usage*/
options cmplib=work.userfuncs;
data _null_;
Gender=female;
scr=100;
age=50;
egfr=egfr(gender,scr,age);
put egfr=;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.