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   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
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   Sun, 29 Nov 2009 15:28:05 -0000

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 
n.j.cox@durham.ac.uk 

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/



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