Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Austin Nichols <austinnichols@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: m:m merge using zip codes |
Date | Mon, 11 Jun 2012 12:02:30 -0400 |
Bryan Stuart <bastuart@umich.edu>: 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 http://www.nber.org/papers/w13246.pdf To compute weighted averages, you can use an unmatched merge e.g. http://www.stata.com/statalist/archive/2007-01/msg00098.html http://www.stata.com/statalist/archive/2009-07/msg00261.html http://www.stata.com/statalist/archive/2009-09/msg00473.html http://www.stata.com/statalist/archive/2009-09/msg00493.html http://www.stata.com/statalist/archive/2011-06/msg00585.html 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 <bastuart@umich.edu> 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: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/