Hi everyone, I am trying to create a new ordinal variable from a set of responses to other non-mutually exclusive binary variables. I believe I am running into trouble with some of my commands overwriting others, resulting in my frequencies being incorrect for the new variable. Can anyone help me correct the code below, or suggest a better methods for creating this variable? I have tried coding many iterations but basically they come down to two main ways: #1 data=dataset1 set dataset anymental=.; if anxiety=0 then anymental=0; if mood=0 then anymental=0; if eating=0 then anymental=0; if anxiety=1 then anymental=1; if mood=1 then anymental=2; if eating=1 then anymental=3; run; #2 data=dataset1 set dataset anymental=.; if anxiety=0 then anymental=0; if anxiety=1 then anymental=1; if mood=0 then anymental=0; if mood=1 then anymental=2; if eating=0 then anymental=0; if eating=1 then anymental=3; run; Neither is giving me the correct frequencies that I'd like to see for the anymental variable.
... View more