Everyone has more than one result in my dataset. I am trying to create a new column that shows if they answered 1 and 2 OR 1 and 3 OR 1 and 5 OR 3 and 5, etc.
This is what I currently have, but it is not looking at the data by ssn which is what I need it to do:
proc sql;
create table diff_answer_combos as
select *
, case when status_flg in (1,2) then "1+2"
when status_flg in (1,3) then "1+3"
when status_flg in (1,4) then "1+4"
when status_flg in (1,5) then "1+5"
when status_flg in (1,6) then "1+6"
when status_flg in (2,3) then "2+3"
when status_flg in (2,4) then "2+4"
when status_flg in (2,5) then "2+5"
when status_flg in (2,6) then "2+6"
when status_flg in (3,4) then "3+4"
when status_flg in (3,5) then "3+5"
when status_flg in (3,6) then "3+6"
when status_flg in (4,5) then "4+5"
when status_flg in (4,6) then "4+6"
when status_flg in (5,6) then "5+6"
else ""
end as status_combined
from duplicates_diff_answer
order by ssn;
quit;
Please help!
Thanks 🙂
... View more