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"
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.