logic order

Other discussions about CSPro
Post Reply
mmhill
Posts: 8
Joined: August 5th, 2014, 3:26 pm

logic order

Post by mmhill » June 26th, 2019, 12:24 pm

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 296 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;

aaronw
Posts: 245
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: logic order

Post by aaronw » June 26th, 2019, 3:58 pm

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.

Post Reply