GithubHelp home page GithubHelp logo

andwax / countyfips Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cbgoodman/countyfips

0.0 2.0 0.0 90 KB

Stata program for merging U.S. county identifiers

License: MIT License

Stata 99.75% TeX 0.25%

countyfips's Introduction

countyfips

countyfips is a simple Stata crosswalk program for adding various county-level identifiers (name, FIPS, Census codes) that may be missing from your dataset. The purpose of this program is to facilitate merging datasets that do not share a common identifier.

Prerequisites

Stata: countyfips 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 countyfips, from(https://raw.github.com/cbgoodman/countyfips/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 countyfips, from(<local source>) replace

Using countyfips

countyfips offers four methods of merging using either county names, 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.

Merging with name where county is the name of county requires either statefips or statecode to be specified

. countyfips, name(county) statefips(stfips)

or

. countyfips, name(county) statecode(stcode)

Merging with fips

. countyfips, fips(county)

Merging with statefips and countyfips

. countyfips, statefips(stfips) countyfips(cofips)

Merging with statecode and countycode

. countyfips, statecode(stcode) countycode(cocode)

By default, countyfips 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.

. countyfips, fips(county) nogenerate

Limitations

  • Using countyfips with the name option requires specific formatting of the name variable. County names must not include "county" after the name. County names beginning with "Saint" such as Saint Louis must be abbreviated to "St."
  • 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).
  • FIPS codes for Virginia independent cities as well as merged county and independent cities (as is the practice for some areas in BEA data) are included. Using countyfips with the name option will require extremely particular formatting. Additionally, only the statefips option will work when merging with name.
  • countyfips 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.

Bugs

Please report any bugs here.

countyfips's People

Watchers

James Cloos avatar Andrew Waxman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.