Skip to content

Stata program for merging U.S. MSA/CBSA identifiers

License

Notifications You must be signed in to change notification settings

cbgoodman/msacrosswalk

Repository files navigation

msacrosswalk

msacrosswalk is a simple Stata crosswalk program for adding 2013, 2015, or 2017 vintage CBSA/CSA codes, CBSA/CSA names, metropolitan/micropolitan, and central/outlying indicators that may be missing from your dataset.

Prerequisites

Stata: msacrosswalk is compatible with Stata version 12.1+. It may be compatible with previous versions, but it has not been tested in those environments.

Installation

Github (for Stata v13.1+): Run the following via the Stata command line.

net install msacrosswalk, from(https://raw.github.com/cbgoodman/msacrosswalk/master/) replace

Github (for Stata v12.1+): Download the zipped file of this repository. Unzip on your local computer. Run the following code via the Stata command line replacing with the location of the unzipped repository on your computer.

net install msacrosswalk, from(<local source>) replace

Using msacrosswalk

msacrosswalk offers three methods of merging using either five-digit county FIPS codes, the combination of two-digit state FIPS and three-digit county FIPS codes, or the combination of two-digit state Census codes and three-digit county Census codes. Vintage must be specified and determines which delineation file to be used. See here for more information.

Merging with fips

. msacrosswalk, fips(county) vintage(year)

Merging with statefips and countyfips

. msacrosswalk, statefips(stfips) countyfips(cofips) vintage(year)

Merging with statecode and countycode

. msacrosswalk, statecode(stcode) countycode(cocode) vintage(year)

By default, msacrosswalk will generate a new variable, _merge, to indicate the merged results. If you do not want to create this variable, specify nogenerate. This will keep matched observations and unmatched master observations.

. msacrosswalk, fips(county) vintage(year) nogenerate

Limitations

  • FIPS codes are available for U.S counties, county equivalents, and territories. Census codes are only available for counties or county equivalents (such as independent cities).
  • msacrosswalk uses the more recent FIPS code for Miami-Dade county (12086) rather than the FIPS code for Dade county (12025). The Census state (10) and county (13) codes remain unchanged.

Next steps

  • Add historical delineation files

Bugs

Please report any bugs here.

About

Stata program for merging U.S. MSA/CBSA identifiers

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published