Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Combining race and Hispanic categorical variables into one race/ethnicity variable

    I am using US Census data and have two variables that I want to combine into one. The first is race which I've already recoded into 5 values (White, Black, Native American, Asian and Multiracial). The second is Hispanic origin which I've recoded into a binary yes or no. I want to combine these into one race/ethnicity categorical variable with the following values:
    • White, non-Hispanic
    • Black, non-Hispanic
    • Native American
    • Asian
    • Multiracial
    • Hispanic
    How do I do this in Stata? Your help is greatly appreciated!

  • #2
    without a sample of your data, this is guesswork; please read the FAQ and post a -dataex- example within CODE blocks

    Comment


    • #3
      How do you prefer to handle Hispanic origin if Race is neither White nor Black? Do you choose Multiethnic or Hispanic?

      With that said, if I guess you have a variable R taking values 1-5 for five racial categories you show (White is 1, and so on), and guess that you have a variable H that is 1 for Hispanic origin and 0 otherwise, then I guess something like this is a start.
      Code:
      generate RE = R
      replace RE = 6 if H==1 & inlist(R,1,2)

      Comment

      Working...
      X