Hello-
I am trying to determine if a patient can be classified as 'GLAU' There are a total of five tests a patient may be given and any 'y' would classify the patient as GLAU. The data looks like below. I've been writing separate if then statements for each test and was wondering if there is an easier way to write code. Any help would be appreciated.
patient | inner_eye_pressure | optic_nerve | field_vision | iris_cornea | cornea |
15385 | y | y | |||
15953 | y | y | |||
14385 | y | y | |||
15996 | y | ||||
15335 | y | y | |||
15004 | y | ||||
15843 | y | ||||
15385 | y |
I was too lazy to type out the variables but the whichc function will work.
You could also nest it into an ifc function if you wanted a oneliner piece of code, but more ppl understand this, I find.
if whichc('y', var1, var2, var3, var4, var5)>0 then classify="GLAU";
else classify = "Other"
I was too lazy to type out the variables but the whichc function will work.
You could also nest it into an ifc function if you wanted a oneliner piece of code, but more ppl understand this, I find.
if whichc('y', var1, var2, var3, var4, var5)>0 then classify="GLAU";
else classify = "Other"
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.