I am looking to create a new variable for employment. The way it is coded right now does not give me the correct frequency distribution because the variables are overlapping. For example, an individual selected income_1 and income_21. This should both go in two groups. For example, group 1 and group 4. SAS is counting the individual for one group and not the other. I am guessing it is because an individual cannot be present in both groups. I have tried different methods but nothing seems to work. Do you recommend any way of handling overlapping variables? I have attached the code below. *creating an employement variable; if income_flag=0 then do; if income_1 eq 1 or income_2 eq 1 or income_3 eq 1 then employment_4cat=1;/* group 1*/ if income_12 eq 1 or income_13 eq 1 or income_14 eq 1 or income_15 eq 1 or income_16 eq 1 or income_17 eq 1 then employment_4cat=2; /*group 2*/ if income_6 eq 1 or income_7 eq 1 or income_8 eq 1 or income_9 eq 1 or income_10 eq 1 or income_21 eq 1 then employment_4cat=2= 3;/*group 3*/ if income_4 eq 1 or income_5 eq 1 or income_11 eq 1 or income_18 eq 1 or income_19 eq 1 or income_compl= "18 years old, left home 2 weeks ago, no source of income at all" then employment_4cat=2=4; /*group 4*/ end; if income_flag=1 then employment_4cat=.; label employment_4cat= "Employment Status"; run;
... View more