Person All the Diagnosis codes for this Person 1 1,2,4 2 2,3,4 3 5,6,7 4 1,2,3,4 If I have a dataset that looks like this, where a variable column contains multiple values per row. So one person can have multiple codes. Here I want to define a new variable that if a person's codes contains either 2 or 3, then new variable =1 otherwise new variable =0. I want something like this: ID Diagnosis code New_Var 1 1,2,4 1 2 2,3,4 1 3 5,6,7 0 4 1,3,4 1
... View more