Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cbgoodman committed Nov 7, 2022
1 parent 98bb1fb commit 14cb0c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ net install countyfips, from(https://raw.github.com/cbgoodman/countyfips/master/
net install countyfips, from(<local source>) replace
```

## Using countyfips
## 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
Merging with `name` where *county* is the name of variable containing county name as a string requires either `statefips` or `statecode` to be specified
```Stata
. countyfips, name(county) statefips(stfips)
```
Expand All @@ -30,17 +30,17 @@ or
. countyfips, name(county) statecode(stcode)
```

Merging with `fips`
Merging with `fips`, where *countyfips* is the name of the variable containing the 5-digit FIPS code
```Stata
. countyfips, fips(county)
```

Merging with `statefips` and `countyfips`
Merging with `statefips` and `countyfips`, where *stfips* and *cofips* are the names of the variables containing the 2-digit state FIPS and 3-digit county FIPS codes
```Stata
. countyfips, statefips(stfips) countyfips(cofips)
```

Merging with `statecode` and `countycode`
Merging with `statecode` and `countycode`, where *stcode* and *cocode* are the names of the variables containing the U.S. Census Bureau Census of Governments state and county codes
```Stata
. countyfips, statecode(stcode) countycode(cocode)
```
Expand All @@ -51,6 +51,20 @@ This will keep matched observations and unmatched master observations.
. countyfips, fips(county) nogenerate
```

## Data Examples:

Merging with 5-digit FIPS codes
```Stata
. webuse texas_ue.dta
. countyfips, fips(fips)
```

Merging with 2-digit state FIPS and 3-digit county FIPS codes
```Stata
. webuse homicide1990.dta
. countyfips, countyfips(cfips) statefips(sfips)
```

## Common Issues

### Permissions
Expand Down
3 changes: 2 additions & 1 deletion countyfips.sthlp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ observations and unmatched master observations.
five-digit county FIPS codes, or the combination of two-digit state FIPS and three-digit
county FIPS codes.{p_end}

{pstd}Merging with {cmd:name}, where {it:county} is the name of variable containing county name as a string{p_end}
{pstd}Merging with {cmd:name}, where {it:county} is the name of variable containing county name as a string requires either {cmd:statefips} or {cmd:statecode} to be specified{p_end}

{phang2}{cmd:. countyfips, name(}{it:county}{cmd:) statefips(}{it:stfips}{cmd:)}{p_end}
{pstd}or{p_end}
{phang2}{cmd:. countyfips, name(}{it:county}{cmd:) statecode(}{it:stcode}{cmd:)}{p_end}
Expand Down

0 comments on commit 14cb0c1

Please sign in to comment.