Good afternoon to all,
I have a set of 765 locations geo coordinates, I am trying to build a matrix that will measure the distance across all the locations in couples where in the principal diagonal report measures the distance between the same location (A to A, B to B, ... , XYZ to XYZ) reported as 1 and in all other intersections the distance between locaction in row and location in column.
The result would be something like:
I have already tried the cross function but I get back just a newvar of all the possible pair distances.
I also tried to use the geodist function, but I think I have to implement a nested loop which would perform operations for any location of origin and any location of destination, with the result of distances in the intersection between them (as just drafted before).
Any hint to resolve this problem, I can't get the way, and I think you ave already realized I'm a newbie here and to exploiting Stata too.
Thank in avance for your help.
I have a set of 765 locations geo coordinates, I am trying to build a matrix that will measure the distance across all the locations in couples where in the principal diagonal report measures the distance between the same location (A to A, B to B, ... , XYZ to XYZ) reported as 1 and in all other intersections the distance between locaction in row and location in column.
The result would be something like:
Toronto | Cape Town | Rome | Buenos Aires | |
Toronto | 1 | km | km | km |
Capetown | km | 1 | km | km |
Rome | km | km | 1 | km |
Buenos aires | km | km | km | 1 |
I also tried to use the geodist function, but I think I have to implement a nested loop which would perform operations for any location of origin and any location of destination, with the result of distances in the intersection between them (as just drafted before).
Any hint to resolve this problem, I can't get the way, and I think you ave already realized I'm a newbie here and to exploiting Stata too.
Thank in avance for your help.
Comment