I have been working on this code for three hours for a school assignment, can you please help? I have a large dataset where I need to combine the ethnicity and race and create a variable called group with the following values: 1 (black non-Hispanic) , 2 (white non-Hispanic), and 3 (Hispanic). The following is the "key" "1"= "American Indian or Alaska Native" "2"= "Asian" "3"= "Black or African American" "4"= "Native Hawaiian or Other Pacific Islander" "5"= "White" "6"= "Other" "7"= "Unknown"; "E1"= "Hispanic or Latino" "E2"= "Non-Hispanic or Latino" "E7"= "Unknown"; I think I might be on to something here with this code but I think I need to make a variable named "group" /*Create a new variable called group*/
DATA=APPENDICITIS.PROJECT3;
if ETHNICITY = "E2" AND RACE = "3" THEN GROUP = "1";
if ETHNICITY = "E2" AND RACE = "5" THEN GROUP = "2";
IF ETHNICITY = "E1" THEN GROUP = "3";
RUN; Thanks so much for your expertise and time.
... View more