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"
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.