Page 1 of 1

logic order

Posted: June 26th, 2019, 12:24 pm
by mmhill
Trying to use a classification algorithm that will cause one of five medical conditions (A-E) to display. DPR10 is the medical condition.
algorithm.PNG
algorithm.PNG (11.07 KiB) Viewed 2210 times
If conditions for "A" not met, then conditions for "B", if not "B" then "C" and so on. Is there a way to structure the skip logic to make this work? (It is possible there aren't adequate unique combinations at this point.)
Thanks.
-MJ

PROC DPR10
if cvox=1 and dpr3 = 2 and cvo_q6=1 and cvo_q7=1 and dpr5a=1 and dpr5b in 1,2 and dpr8 in 1,2 then
dpr10="Title: A. Definite fatal MI";
skip to dpr11;

elseif cvox=2 and dpr3 = 2 and (cvo_q6=2 or cvo_q7=2) and dpr5b=1 then
dpr10="Title: A. Definite fatal MI";
skip to dpr11;

elseif dpr3=2 and ((dpr6=1 and dpr7=2) or (dpr6=2 and dpr7=1) or (dpr6=2 and dpr7=2)) then
dpr10="Title: B. Definite fatal CHD";
skip to dpr11;

elseif dpr3 = 2 and dpr8 = 1 then
dpr10= "Title: C. Possible fatal CHD";
skip to dpr11;

elseif dpr3 = 1 then
dpr10 = "Title: D. Non-CHD death";
skip to dpr11;

elseif dpr3 = 2 and dpr8 = 2 then
dpr10="Title: E. Unclassifiable";
skip to dpr11;
endif;

Re: logic order

Posted: June 26th, 2019, 3:58 pm
by aaronw
Looking at the rows in the image, the different combinations do look unique (I am assuming n/a is blank). However, your if statements do not match the given image. For instance, I don't see a cvo_q7 column in the image. In general it looks like you have the right idea.