Statalist


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

Re: st: Constructing assignment var for Spatial RDD: For each id in region 1 need shortest distance to an id in region 0


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: Constructing assignment var for Spatial RDD: For each id in region 1 need shortest distance to an id in region 0
Date   Tue, 1 Dec 2009 08:18:21 -0500

Chris <[email protected]>:
-vincenty- should work fine for you; in some rare cases it may return
a missing value for distance.  The help file says:

The Vincenty-style calculations may fail if distance is close to a
quarter of the Earth's circumference, or if it is close
to zero, where the trig functions tax the limits of machine precision.
Haversine calculations and those based on the Law
of Cosines are more robust to these odd cases.


On Mon, Nov 30, 2009 at 6:55 PM, Stata Chris <[email protected]> wrote:
> The -vincenty- command is, according to its help menu, not robust when
> distances are "close to zero"; mine should range between 0 and 100km,
> but with many within 50km; not sure what exactly classifies as "close
> to zero" in this context, but I take it that <50km might, and from the
> two you suggest as possible alternatives to -nearest-, the
> Haversine-based  -distmatch-  would appear more suitable.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index