wbhaom: Race/ethnicity, including Asian and multiple

wbhaom title image

Description

wbhaom is the six-category race or ethnicity of the individual, including Asian and 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 Asian
5 Native American
6 Multiple races

Detailed comments

Significant race/ethnicity coding changes occur in 2012.

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

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 wbhaom = 1 if ptdtrace == 1
        replace wbhaom = 2 if ptdtrace == 2
        replace wbhaom = 4 if ptdtrace == 4 | ptdtrace == 5 /* Asian or HP */
        replace wbhaom = 5 if ptdtrace == 3 /* AI only */
        replace wbhaom = 6 if 6 <= ptdtrace & ptdtrace <= 21 /*multiple*/
        * Hispanic ethnicity
        replace wbhaom = 3 if hispanic == 1
    }
    if tm(2012m5) <= $date {
        replace wbhaom = 1 if ptdtrace == 1
        replace wbhaom = 2 if ptdtrace == 2
        replace wbhaom = 4 if ptdtrace == 4 | ptdtrace==5 /* Asian or HP */
        replace wbhaom = 5 if ptdtrace == 3 /* AI only */
        replace wbhaom = 6 if 6 <= ptdtrace & ptdtrace <= 26 /*multiple*/
        * Hispanic ethnicity
        replace wbhaom = 3 if hispanic == 1
    }
}

lab var wbhaom "Race/ethnicity, including Asian and multiple"
#delimit ;
lab define wbhaom
1 "White"
2 "Black"
3 "Hispanic"
4 "Asian"
5 "Native American"
6 "Multiple races";
#delimit cr
lab val wbhaom wbhaom
notes wbhaom: Racial and ethnic categories are mutually exclusive
notes wbhaom: Asians include Hawaiian/Pacific Islanders
notes wbhaom: Available 2003-present; definition changes in 2012m5, 2014
notes wbhaom: Hispanic definition from variable hispanic
notes wbhaom: 2003-present CPS: ptdtrace
Figure creation
keep if age >= 16 & age ~= .
keep if wbhaom ~= .

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

gen str5 formatvalue = ""
levels wbhaom, local(levels)
foreach l of numlist `levels' {
    sum share if wbhaom == `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 wbhaom if wbhaom == 1, barwidth(0.7) color("`color2'") || ///
bar share wbhaom if wbhaom == 2, barwidth(0.7) color("`color1'") || ///
bar share wbhaom if wbhaom == 3, barwidth(0.7) color("`color3'") || ///
bar share wbhaom if wbhaom == 4, barwidth(0.7) color("`color4'") || ///
bar share wbhaom if wbhaom == 5, barwidth(0.7) color("`color5'") || ///
bar share wbhaom if wbhaom == 6, 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("`color5'")) ///
text(`formatyvalue6' 6 "`formatvalue6'", color("`color6'"))
graph export ${variableimages}wbhaom_titleimage.svg, replace

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