Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: calculate pairwise distance between tracts


From   sara borelli <[email protected]>
To   [email protected]
Subject   st: calculate pairwise distance between tracts
Date   Thu, 4 Nov 2010 21:21:16 +0000 (GMT)

Dear statalister
I am trying to calcluate pariwise distance between census tracts whithin state. I have longitude and latitude for each tract and I know vincenty command calculate distance
However, I am having sme troubles to organize data in the appropriate way to apply the command

suppose I have
tract
1
2
3

if I put the data in the form

tract_orgin	tract_Dest   long_orig    long_dest  lat_orig    lat_dest
1		1
1		2
1		3
2		1
2		2
2		3
3		1
3		2
3		3

 if I organize the data in this way I can apply 
vincety (lat_orig long_orig lat_dest long_dest) whihc gives me distance between any 2 tracts

the problem is that I am having hard time to organize the data in that format given the large number of census tracts

any suggestion on how to do this efficiently?
thanks



      

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index