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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: Re: Nearstat version


From   "P. Wilner Jeanty" <pwjeanty@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: Nearstat version
Date   Mon, 6 Feb 2012 10:33:26 -0600

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/


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