Announcement

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

  • Map US Zip Codes to US Census Region

    I have a Zip Code variable; however, I need a US Census Region variable. Does anyone know how to map US Zip Codes to US Census Regions? Are there any STATA programs to do this mapping?

    Thank you,

    Chris

  • #2
    I don't know of any Stata programs for this purpose. But you can download a text file from http://www2.census.gov/geo/docs/maps...act_rel_10.txt which shows a great deal of information about each zip code, including the state, and you can import that into Stata. Then you can just find a listing of which states belong to which census regions at http://www2.census.gov/geo/docs/maps...ps/reg_div.txt. (This one is not suitable for importation, but you can easily hand-create a crosswalk between states and census regions. So then it's just a matter of two -merge- commands.

    Comment


    • #3
      I just remembered that I have a file that maps the state codes to census regions, so you don't have to mess with http://www2.census.gov/geo/docs/maps...ps/reg_div.txt.

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input str24 name byte(fips_state_code census_region)
      "Michigan"       26 2
      "Wisconsin"      55 2
      "Indiana"        18 2
      "Ohio"           39 2
      "Illinois"       17 2
      "Mississippi"    28 3
      "Kentucky"       21 3
      "Alabama"         1 3
      "Tennessee"      47 3
      "Pennsylvania"   42 1
      "New York"       36 1
      "New Jersey"     34 1
      "Wyoming"        56 4
      "Idaho"          16 4
      "New Mexico"     35 4
      "Colorado"        8 4
      "Arizona"         4 4
      "Montana"        30 4
      "Utah"           49 4
      "Nevada"         32 4
      "Maine"          23 1
      "New Hampshire"  33 1
      "Massachusetts"  25 1
      "Rhode Island"   44 1
      "Connecticut"     9 1
      "Vermont"        50 1
      "Alaska"          2 4
      "Washington"     53 4
      "Oregon"         41 4
      "Hawaii"         15 4
      "California"      6 4
      "South Carolina" 45 3
      "Washington DC"  11 3
      "North Carolina" 37 3
      "Delaware"       10 3
      "Maryland"       24 3
      "Florida"        12 3
      "Virginia"       51 3
      "Georgia"        13 3
      "West Virginia"  54 3
      "North Dakota"   38 2
      "Nebraska"       31 2
      "Minnesota"      27 2
      "Kansas"         20 2
      "South Dakota"   46 2
      "Iowa"           19 2
      "Missouri"       29 2
      "Arkansas"        5 3
      "Texas"          48 3
      "Oklahoma"       40 3
      "Louisiana"      22 3
      end
      label values census_region census_region
      label def census_region 1 "Northeast", modify
      label def census_region 2 "Midwest", modify
      label def census_region 3 "South", modify
      label def census_region 4 "West", modify
      Unfortunately, I cannot seem to find an audit trail of where I got this from, so I can't provide you with a reference to cite.

      Comment


      • #4
        Just a note of gratitude for this extremely handy bit of code from some 5 years ago. Thanks very much for sharing this, Clyde.

        Comment

        Working...
        X