logic order
Posted: 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.
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;
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;