Announcement

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

  • matching/mapping county fips and zip codes

    Hi!
    I have just started to work with stata. Therefore, I would be happy if anyone could help me out.

    I have two files. One file contains 3-digit zip codes (e.g. 303xx) and one file contains county fips and the corresponding social capital index (downloaded from the NRCRD). Now I would like to match those to get the social capital index for the zip code(s).
    Is there a code or package in stata which can map fips and zip codes?

    Thanks a lot in advance!

  • #2
    A U.S. zip [postal] code can include areas in more than one county, so I'm not sure how you would want to handle that. Further, 3-digit zip codes (have not heard of these before), as broader units, will presumably *commonly* have more than one county within them.

    A bit of ordinary searching on /"zip code" counties overlap/ revealed the following: https://www.huduser.gov/portal/datas...crosswalk.html

    This purports to offer a zip to county "crosswalk," which is what you need. I have not used this file, and I don't know how it handles the many-to-one feature of the county-zip relation. I'd suggest you download the crosswalk file there, import it to Stata (it's an Excel file: -help import excel-). Everything from there on depends crucially on the exact structure of your files, but it will involve at least one -merge- and likely the use of the -substr()- function to create 3 digit zip codes from the 5 digit codes. See -help merge- and -help substr()- if you want to puzzle it out yourself.

    Presuming you do want more detailed help: Check out the StataList FAQ re the -dataex- command and use it to prepare and post small samples of your county/zip file, your county/social capital file, and the zip/county crosswalk file. Given that info, many people here will be able to give you detailed help. (BTW: StataList has *many* (mostly??) non-U.S. and non-social scientist participants.. Writing a question that does not require their cultural knowledge will considerably expand your set of potential helpers.) In a similar vein, there's no harm in noting the fact that your file came from NRCRD (whatever that is), but it's relevant only to people who use that file, which is presumably less than 1/10000th of the StataList population.

    Comment

    Working...
    X