Hi there, I am looking for functions or ideas on how to analysis the below example dataset: What i would like to do it using the colour columns, create a new variable which assigns the favourite colour of each individual. So for person1 a simple IF statement would be fine as they only have 1 favourite colour, I can say 'if red = 1 then fav_colour = red'. However, the issue is when a person has more than one favourite colour i want to be able to assign 2 separate variables that have the 2 different colours in it. red yellow blue green orange fav_colour fav_colour2 fav_colour3 person1 1 0 0 0 0 red person2 0 0 0 0 1 orange person3 0 1 0 1 0 yellow green person4 0 0 1 0 0 blue person5 1 0 0 1 1 red green orange I have been looking at using arrays and do loops but am struggling to figure out how best to use these, so any ideas on functions that could be useful would be very much appreciated. (I have SAS Enterprise Guide version 7.11) Thanks!
... View more