Skip to content

wbhom: Race/ethnicity, including multiple

wbhom title image

Description

wbhom is the five-category race or ethnicity of the individual, including multiple races.

Availability

Sample Years
Basic 2003 - present
ORG 2003 - present

Warning

This variable is mostly consistent over time, but there are race/ethnicity coding changes in 2012m5 and 2014. See the race/ethnicity methodology for more details.

Values

Value Label
1 White
2 Black
3 Hispanic
4 Other
5 Multiple races

Detailed comments

Significant race/ethnicity coding changes occur in 2012.

Code

Variable creation
********************************************************************************
* Race: WBHOM
********************************************************************************
* follow coding at http://ceprdata.org
gen byte wbhom = .

if $monthlycps == 1 {
    if tm(2003m1) <= $date & $date <= tm(2012m4) {
        * May 2004- July 2005: ptdtrace variable renamed to ptdtrace
        if tm(2004m5) <= $date & $date <= tm(2005m7) {
            *ptdtrace will exist due to generate_wbho.do. else:
            *gen ptdtrace = prdtrace
        }
        replace wbhom = 1 if ptdtrace == 1
        replace wbhom = 2 if ptdtrace == 2
        replace wbhom = 4 if 3 <= ptdtrace & ptdtrace <= 5
        replace wbhom = 5 if 6 <= ptdtrace & ptdtrace <= 21 /*multiple*/
        replace wbhom = 4 if ptdtrace == 13 /* AI-asian */ | ptdtrace == 14 /* Asian-HP */
        * Hispanic ethnicity
        replace wbhom = 3 if hispanic == 1
    }
    if tm(2012m5) <= $date {
        replace wbhom = 1 if ptdtrace == 1
        replace wbhom = 2 if ptdtrace == 2
        replace wbhom = 4 if 3 <= ptdtrace & ptdtrace <= 5
        replace wbhom = 5 if 6 <= ptdtrace & ptdtrace <= 26 /*multiple*/
        replace wbhom = 4 if ptdtrace == 13 /* AI-asian */ | ptdtrace == 14 /* AI-HP */ /*
    */ | ptdtrace == 15 /* Asian-HP */
        * Hispanic ethnicity
        replace wbhom = 3 if hispanic == 1
    }
}

lab var wbhom "Race/ethnicity, including multiple"
#delimit ;
lab define wbhom
1 "White"
2 "Black"
3 "Hispanic"
4 "Other"
5 "Multiple races";
#delimit cr
lab val wbhom wbhom
notes wbhom: Racial and ethnic categories are mutually exclusive
notes wbhom: Available 2003-present; definition changes in 2012m5, 2014
notes wbhom: Hispanic definition from variable hispanic
notes wbhom: From 2003, black, white, and other exclude all respondents /*
*/ listing more than one race, except AI-Asian, AI-HP, Asian-HP, which /*
*/ are included in other
notes wbhom: 2003-present CPS: ptdtrace
Figure creation
keep if age >= 16 & age ~= .
keep if wbhom ~= .

replace basicwgt = basicwgt/12
gcollapse (sum) count=basicwgt, by(wbhom)
sum count, d
local total = r(sum)
gen share = count / `total' * 100

gen str5 formatvalue = ""
levels wbhom, local(levels)
foreach l of numlist `levels' {
    sum share if wbhom == `l'
    local formatvalue`l': di %3.1f r(mean) "%"
    local formatyvalue`l' = r(mean)+2

}

gen share2 = share + 2

local color1 228 26 28
local color2 55 126 184
local color3 77 175 74
local color4 152 78 163
local color5 255 127 0
local color6 166 86 40

twoway ///
bar share wbhom if wbhom == 1, barwidth(0.7) color("`color2'") || ///
bar share wbhom if wbhom == 2, barwidth(0.7) color("`color1'") || ///
bar share wbhom if wbhom == 3, barwidth(0.7) color("`color3'") || ///
bar share wbhom if wbhom == 4, barwidth(0.7) color("`color4'") || ///
bar share wbhom if wbhom == 5, barwidth(0.7) color("`color6'") ///
legend(off) ///
xlabel(,valuelabel labsize(small)) ///
ylabel(0(20)60 60 "60%", angle(0) gmin gmax) yscale(r(0 67)) ///
xtitle("") ytitle("") ///
graphregion(color(white)) plotregion(color(white)) ///
title("Share of population by race/ethnicity, ages 16 and over", size(medium)) ///
text(`formatyvalue1' 1 "`formatvalue1'", color("`color2'")) ///
text(`formatyvalue2' 2 "`formatvalue2'", color("`color1'")) ///
text(`formatyvalue3' 3 "`formatvalue3'", color("`color3'")) ///
text(`formatyvalue4' 4 "`formatvalue4'", color("`color4'")) ///
text(`formatyvalue5' 5 "`formatvalue5'", color("`color6'"))
graph export ${variableimages}wbhom_titleimage.svg, replace

/***
Significant race/ethnicity coding changes occur in 2012.
***/