Hi, I have eGFR data with multiple eGFR values per patient. And I want to select the eGFR value closest to diagnosis date (+-2 months). And for patients with multiple values in +-2 months period I want to select the eGFR value prior to diagnosis and closest to diagnosis date. I am not able to write the code for the "elect the eGFR value prior to diagnosis and closest to diagnosis ". Appreciate any help I can get. Here is the code I have so far: data Y; set X; CalCreDiff=eGFRdate-DX_DATE; AbsCaleGFRDiff=abs(CalCreDiff); if -60<=AbseCaleGFRDiff=<60; run;
... View more