Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: m:m merge using zip codes

From   Austin Nichols <>
Subject   Re: st: m:m merge using zip codes
Date   Mon, 11 Jun 2012 12:02:30 -0400

Bryan Stuart <>:
Better to use exact lat/lon and compute a weighted average over Census
blocks/tracts/whatever.  There is nothing special about a zip code
boundary in defining the neighborhood of a prison, right?  See also
page 55 of

To compute weighted averages, you can use an unmatched merge e.g.
or do the same thing in Mata (each dataset a matrix), which is faster.

On Mon, Jun 11, 2012 at 11:45 AM, Bryan Stuart <> wrote:
> Hello,
> I have two data sets. In one, each row represents a prison. Each prison has
> a zip code, but there exist some zip codes with multiple prisons. The other
> data set (from geocorr) maps zip codes into PUMAs. Some zip codes map into
> multiple PUMAs. Ultimately, I want to connect each prison to a PUMA. Zip
> codes are not unique identifiers in either data set.
> An m:m merge is undesirable here because it isn't consistent. Simply
> appending the datasets together (and then filling in the missing columns)
> isn't ideal either, as some prison zip codes are not in the geocorr dataset
> (because they are located in rural areas, the Census Bureau doesn't assign
> zip codes to some areas).
> Any ideas on how to combine these datasets? Thanks!
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index