Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Choosing the best set of longitude/latitude coordinates from three choices


From   Matthew Krauchunas <krauchunasms@mymail.vcu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Choosing the best set of longitude/latitude coordinates from three choices
Date   Wed, 14 Jul 2010 13:25:26 -0400

Thank you Eric, that worked perfectly!

On Wed, Jul 14, 2010 at 12:29 PM, Eric Booth <ebooth@ppri.tamu.edu> wrote:
> <>
>
> That's a good point.  My example takes the minimum, not the minimum difference, so my loop in the previous post should be run on the absolute value of the differences that you calculated.
>
> ~ Eric
> __
> Eric A. Booth
> Public Policy Research Institute
> Texas A&M University
> ebooth@ppri.tamu.edu
> Office: +979.845.6754
>
> On Jul 14, 2010, at 11:25 AM, Matthew Krauchunas wrote:
>
>> Still messing around with this and I decided to take the absolute
>> value of the differences to make it easier.  Thus, the data now looks
>> like this:
>>
>> oshpd_fac_no  oshpd_lat       oshpd_long      usc_lat usc_long        intel_lat       intel_long      oshpd_usc_lat_diff      oshpd_usc_long_diff     oshpd_intel_lat_diff    oshpd_intel_long_diff   intel_usc_lat_diff      intel_usc_long_diff
>> 206194113     34.22875        -118.3627       34.2298 -118.3629       34.2286 -118.3622       0.001053        0.000237        0.000145        0.000481        0.001198        0.000717
>> 206194139     34.13254        -117.8698       34.13291        -117.8695       34.13241        -117.87 0.000370        0.000275        0.000130        0.000153        0.000500        0.000427
>> 206194199     34.07075        -118.2026       34.07106        -118.2035       34.07067        -118.2026       0.000309        0.000870        0.000076        0.000015        0.000385        0.000854
>> 206194202     34.69315        -118.157        34.69262        -118.1575       34.69285        -118.157        0.000534        0.000465        0.000298        0.000069        0.000237        0.000534
>> 206194284     34.14379        -117.9671       34.14771        -117.9673       34.1431 -117.9675       0.003922        0.000198        0.000687        0.000435        0.004608        0.000237
>> 206194320     34.03258        -118.3131       37.40501        -122.0915       37.40488        -122.0914       3.372433        3.778336        3.372299        3.778236        0.000134        0.000099
>> 206194400     34.25798        -118.5727       34.25804        -118.5728       34.25835        -118.5725       0.000057        0.000031        0.000370        0.000252        0.000313        0.000282
>> 206194558     34.28158        -118.4623       34.28167        -118.4608       34.28154        -118.4608       0.000095        0.001503        0.000042        0.001472        0.000137        0.000031
>> 206194563     34.27824        -118.3992       34.28155        -118.4024       34.28153        -118.4026       0.003311        0.003250        0.003292        0.003410        0.000019        0.000160
>>
>>
>> On Wed, Jul 14, 2010 at 11:19 AM, Matthew Krauchunas
>> <krauchunasms@mymail.vcu.edu> wrote:
>>> Hello,
>>>
>>> The data management process for my dissertation is fraught with
>>> obstacles beyond my current Stata abilities, so I am returning to the
>>> "well" where everyone has been extremely helpful.
>>>
>>> I have some geocoded data from three sources and I need to figure out
>>> a way to choose the best set of coordinates.  The source of the
>>> coordinates are Intelligentsearch GIS (intel_lat & intel_long), USC
>>> GIS (usc_lat & usc_long), and OSHPD provided GIS (oshpd_lat &
>>> oshpd_long).  The OSHPD GIS also has 71 missing longitudes and
>>> latitudes.  I have calculated the difference between these three sets
>>> of coordinates:  Intelligentsearch & USC
>>> (intel_usc_lat_diff     intel_usc_long_diff), OSHPD & USC
>>> (oshpd_usc_lat_diff oshpd_usc_long_diff), and OSHPD &
>>> Intelligentsearch (oshpd_intel_lat_diff oshpd_intel_long_diff).  I
>>> need to keep the best coordinates (i.e., from two datasources with the
>>> smallest difference), name the new coordinates longitude and latitude,
>>> and use the USC coordinates as the default (i.e., use the USC
>>> coordinates when the smallest difference is between USC and
>>> Intelligentsearch).
>>>
>>> Let me provide an example:  oshpd_fac_no 206194320 has a
>>> oshpd_usc_lat_diff of -3.372433, oshpd_intel_lat_diff of -3.372299,
>>> and a intel_usc_lat_diff of 0.000134. Obviously the OSHPD gis is the
>>> problem and the USC latitude needs to be kept as it is my default.
>>>
>>> Does anyone have any ideas for this?
>>>
>>> Here is some sample data if it helps:
>>>
>>> oshpd_fac_no    intel_usc_lat_diff      intel_usc_long_diff     oshpd_usc_lat_diff      oshpd_usc_long_diff     oshpd_intel_lat_diff    oshpd_intel_long_diff   oshpd_long      oshpd_lat       usc_lat usc_long        intel_lat       intel_long
>>> 206271717       -2.928555       4.037598        2.928555        -4.037582       0.000000        0.000015        -121.9128       36.56206        33.63351        -117.8752       36.56206        -121.9128
>>> 206100833       -0.124664       0.399834        0.123066        -0.401627       -0.001598       -0.001793       -119.4988       37.10662        36.98355        -119.0972       37.10822        -119.497
>>> 206491017       -0.086819       0.052116        0.024086        -0.007385       -0.062733       0.044731        -122.4599       38.27798        38.25389        -122.4525       38.34071        -122.5046
>>> 206044001       -0.058876       -0.041939       0.058018        0.040482        -0.000858       -0.001457       -121.598        39.78528        39.72726        -121.6385       39.78614        -121.5965
>>> 206190123       -0.056854       -0.162796       0.054424        0.182648        -0.002430       0.019852        -118.2801       34.05378        33.99936        -118.4627       34.05621        -118.2999
>>> 206281040       -0.050270       -0.041695       0.000572        0.000282        -0.049698       -0.041412       -122.3058       38.31432        38.31374        -122.3061       38.36401        -122.2644
>>> 206040974       -0.039154       -0.023483       0.043438        0.026169        0.004284        0.002686        -121.6123       39.7707 39.72726        -121.6385       39.76641        -121.615
>>> 206070948       -0.038231       -0.044518       -0.001057       -0.000832       -0.039288       -0.045349       -122.132        37.88853        37.88959        -122.1312       37.92782        -122.0867
>>> 206374019       -0.036625       -0.008965       -0.001068       -0.000153       -0.037693       -0.009117       -116.984        32.83546        32.83652        -116.9839       32.87315        -116.9749
>>> 206301202       -0.033604       -0.016846       -0.000050       -0.001251       -0.033653       -0.018097       -117.836        33.74546        33.74551        -117.8347       33.77912        -117.8179
>>> *
>
>
>
> *
> *   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/
>

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index