Thanks to Roy for the mention of -nearest-, which is downloadable from
SSC.
However, I am puzzled by these remarks. A glance at the help shows that
-nearest- supports -if- and -in-. Thus I do not know why Stata Chris is
in doubt on this point, or why Roy is trying to explain their absence!
Nick
[email protected]
Roy Wada
I probably should have added a few more thing. -nearest- is written by
Nick Cox. Not allowing [if] [in] was probably intentional. People will
obviously try to use it that way, not realizing it will apply to the
entire sample.
I hope you are pre-multiplying the longitude or latitutde by a factor
of 60.9 or something. Otherwise you are dealing with a
squashed-looking map. If you want a geographical distance, try
-distmatch- from ssc.. It has a one-direction mapping via -donor( )-
and -recipient( )- options. There is also -vincent- by Austin Nichols
that you may want to check.
Stata Chris
Thanks, that's a very convenient command!!
I just haven't been able to figure out how to restrict it to search for
the each member of group 0 (1) not the closest one of all but the
closest one only from the respective other group, since -nearest-
doesn't seem to allow if conditions.
*
* 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/