[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Is Stata used for spatial statistics/GIS?
You should check out nearest.ado on SSC (by Nick Cox). It will identify the
nearest neighbor (Euclidian distance). I have written an alternate version
that allow a globe option (for spherical distances) and is much faster on
larger datasets (avoids brute-force N*N loop). If you find nearest too
slow or need global distances, I can email you my program. Either program
could probably be revised to identify all observations within a certain
distance, but it is not clear how it would deal with cases where there are
many observations meeting the criteria (just list them out? or create many
added variables to hold their identities?)
----- Original Message -----
From: "Tim R. Sass" <firstname.lastname@example.org>
Sent: Thursday, February 19, 2004 9:19 AM
Subject: Re: st: Is Stata used for spatial statistics/GIS?
> There is a user-written ado file available on the SSC site, sphdist, that
> will compute the spherical distance between two points based on the
> latitude and longitude of each. Otherwise, I am unaware of any GIS-type
> routines within Stata. If anyone out there has written an ado file to
> the identities of observations within a specified distance of another
> observation (eg. given a listing of hospitals and their
> calculating which hospitals are within 5 miles of hospital A), I would be
> interested in knowing about it.
* For searches and help try: