Hello,
I have a data set, SAMPLE, here:
ID
Name
Status
1
David
Cool
1
David
Cool
1
David
Not Cool
2
Sam
Warm
For each group I want to select the first occurrence of STATUS where the value is "Cool" and set my new variable Bingo as "Cool Person". I want categorize duplicate values of "Cool" for the variable STATUS, as well as other values of STATUS in the group with the variable, Bingo, as "Other Statuses for this person". I want to also categorize other groups without the value of "Cool" for STATUS as "Other Statuses" for BINGO. If possible I would like one data step or proc sql step for this. I know I need to sort the data too.
I want the data to look something like this
ID
Name
Status
Bingo
1
David
Cool
Cool Person
1
David
Cool
Other Status for this person
1
David
Not Cool
Other Status for this person
2
Sam
Warm
Other Statuses
How can achieve this? Any help with this is welcome and much appreciated!
Thank you,
J
Add Tags
0 Likes
Quick Reply
... View more