generate_race_var

ACS and CPS microdata utilities

Generate a race-ethnicity variable in ACS or CPS microdata.

Description

generate_race_var generates a categorical variable for race-ethnicity in ACS or CPS microdata.

Users may specify the desired number of categories for the new variable; see Categories and labels.

In ACS microdata, the variables rac1p and hisp must exist. In CPS microdata, the variables prdtrace and pehspnon must exist.

Syntax

generate_race_var newvar, dataset(acs|cps) categories(integer) [options]
Option Description
dataset(string) The type of dataset in memory; ACS or CPS (case insensitive).
categories(integer) Number of categories for newvar. With dataset(acs), up to 8. With dataset(cps), up to 7. See Categories and Labels.
nolabel Do not assign value labels to newvar.

Categories and labels

Categories Values and Labels
2
  1. White, not Latino
  2. Another race or multiracial
4
  1. White, not Latino
  2. Black, not Latino
  3. Latino (of any race)
  4. Another race or multiracial, not Latino
5
  1. White, not Latino
  2. Black, not Latino
  3. Latino (of any race)
  4. Asian, not Latino
  5. Another race or multiracial, not Latino
6
  1. White, not Latino
  2. Black, not Latino
  3. Latino (of any race)
  4. Asian, not Latino
  5. American Indian or Alaska Native, not Latino
  6. Another race or multiracial, not Latino
7 (ACS)
  1. White, not Latino
  2. Black, not Latino
  3. Latino (of any race)
  4. Asian, not Latino
  5. American Indian or Alaska Native, not Latino
  6. Native Hawaiian or Pacific Islander, not Latino
  7. Another race or multiracial, not Latino
7 (CPS)
  1. White, not Latino
  2. Black, not Latino
  3. Latino (of any race)
  4. Asian, not Latino
  5. American Indian or Alaska Native, not Latino
  6. Native Hawaiian or Pacific Islander, not Latino
  7. Multiracial, not Latino
8 (ACS only)
  1. White, not Latino
  2. Black, not Latino
  3. Latino (of any race)
  4. Asian, not Latino
  5. American Indian or Alaska Native, not Latino
  6. Native Hawaiian or Pacific Islander, not Latino
  7. Another race, not Latino
  8. Multiracial, not Latino

Examples

Generate a 5-category race-ethnicity variable in ACS microdata.

generate_race_var race_cat, dataset("acs") categories(5) 

Generate an unlabeled 2-category race-ethnicity variable in CPS microdata.

generate_race_var person_of_color, categories(2) dataset("cps") nolabel