Dear all,
I have two groups: group 1: 2,109 observations; group 2: 1,615 observations, which is indicated by two binary variables: group1 (1 if part of group1, 0 if not), group2 (1 if part of group2, 0 if not).
However, group 1 actually includes group 2.
I want to create a variable that indicates 1 if the observation is part of group 1 (2,109); and a 2 if an observation is part of group 2 (identifying 1,615 observations)
However, the tricky part is, I do not want to override the 1 values with the 2 values as this would happen if I would use:
Is there a way to achieve this?
Thank you all in advance!
I have two groups: group 1: 2,109 observations; group 2: 1,615 observations, which is indicated by two binary variables: group1 (1 if part of group1, 0 if not), group2 (1 if part of group2, 0 if not).
However, group 1 actually includes group 2.
I want to create a variable that indicates 1 if the observation is part of group 1 (2,109); and a 2 if an observation is part of group 2 (identifying 1,615 observations)
However, the tricky part is, I do not want to override the 1 values with the 2 values as this would happen if I would use:
Code:
gen total_group=. replace total_group=1 if group1==1 replace total_group=2 if group2==1
Thank you all in advance!
Comment