Skip to content

countyfips: County - FIPS code

countyfips title image

Description

countyfips is the three digit FIPS county code of the household which must be used in conjunction with the state FIPS code statefips.

Availability

Sample Years
Basic 2004m5 - present
ORG 2004m5 - present

In some years, roughly 60% of observations do not have county identifiers. Sometimes very populous counties are not identified with countyfips but will be included as part of a metropolitan area (see cbsafips).

Warning

This variable is the original code on file and is not consistent over time.

Values

Value Label
0 Not identified

Code

Variable creation
********************************************************************************
* County
********************************************************************************
gen countyfips = .

if $monthlycps == 1 {
    if tm(1995m9) <= $date & $date <= tm(2004m4) {
        replace countyfips = geco
    }
    if tm(2004m5) <= $date {
        replace countyfips = gtco
}
}

lab var countyfips "County - FIPS code"
lab def countyfips 0 "Not identified"
lab val countyfips countyfips
notes countyfips: 1995m9-2004m4, CPS: geco
notes countyfips: 2004m5-present, CPS: gtco
notes countyfips: Not consistent over time
Figure creation
sum year
local maxyear = r(max)
keep if year == `maxyear'

keep if age >= 16 & age <= 64

tostring statefips, gen(state) format(%02.0f)
tostring countyfips, gen(county) format(%03.0f)
replace county = state + county
destring county, replace
gcollapse (count) n=year, by(county)

local color1 123 50 148
local color2 194 165 207
local color3 166 219 160
local color4 0 136 55

#delimit ;
maptile n,
  geo(county2014) fcolor(BrBG) ndfcolor(white)
  twopt(
    graphregion(color(white))
    title("County identified sample sizes of individuals ages 16-64 in `maxyear'", size(medium))
  )
;
#delimit cr;

graph export ${variableimages}countyfips_titleimage.svg, replace