st: Re: Nearstat version

2012/2/5 Rüdiger Vollmeier <ruediger.vollmeier@googlemail.com>:
> Thanks a lot for the good advice how to run the program.
>
> I ve got one question regarding the programming: It seems that in case
> of non-identical observations with identical longitude and latitude,
> the programs does not return the distance 0 but calculates the
> shortest distance to non-identical latitude and longitudes. Am I
> right? This is surprising and, I guess, for many users not desired. Is
> it possible to change that (such that the distance 0 will be returned
> in these cases)?
This is a legitimate behavior by the program. Because it does not
stand to reason that two different locations have identical latitudes
and longitudes, -nearstat- thinks that it is computing the distance
between an observation and itself. In order to identify the nearest
neighbors (1st, 2nd, 3rd, and so forth), distance computed from an
observation to itself is intentionally set to missing as part of the
programming process. Ruediger's case where non-identical observations
have identical latitudes and longitudes is an unusual one. As a
result, I don't intend to modify -nearstat- to allow for it, at least
not now, unless many users want this change to be made. Without more
information, I find it odd that non-identical observations or areal
units have identical latitudes and longitudes.
FYI, a new version of -nearstat- with Mata code compiled in Stata 10.1
has been submitted to SSC.
Regards,
Wilner
--------------------------------
P. Wilner Jeanty
Rice University
Email: pwjeanty@rice.edu
*
* 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/