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   Roy Wada <[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   Fri, 27 Nov 2009 20:19:54 -0800

> 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.

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.

Roy
*
*   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