|
|||
|
Hi,
I am trying to group a list of cities based on distances from each other. The distance matrix as provided in the below dataset shows distances from each city to the eight closest cities (c1-c8). The corresponding distances (in ascending order) to each of these cities are in columns d1-d8. data have; infile cards dlm = ',' dsd missover; input city $ c1 $ d1 c2 $ d2 c3 $ d3 c4 $ d4 c5 $ d5 c6 $ d6 c7 $ d7 c8 $ d8; cards; Berlin,Cairo,1795,Calcutta,4368,Chicago,4405,Carac as,5247,HK,5440,Cape,5981,Honolulu,7309,BA,7402 BA,Caracas,3168,Cape,4269,Chicago,5598,Cairo,7345, Berlin,7402,Honolulu,7561,Calcutta,10265,HK,11472 Cairo,Berlin,1795,Calcutta,3539,Cape,4500,HK,5061, Chicago,6129,Caracas,6338,BA,7345,Honolulu,8838 Calcutta,HK,1648,Cairo,3539,Berlin,4368,Cape,6024, Honolulu,7047,Chicago,7980,Caracas,9605,BA,10265 Cape,BA,4269,Cairo,4500,Berlin,5981,Calcutta,6024, Caracas,6365,HK,7375,Chicago,8494,Honolulu,11534 Caracas,Chicago,2501,BA,3168,Berlin,5247,Honolulu, 6013,Cairo,6338,Cape,6365,Calcutta,9605,HK,10167 Chicago,Caracas,2501,Honolulu,4250,Berlin,4405,BA, 5598,Cairo,6129,HK,7793,Calcutta,7980,Cape,8494 HK,Calcutta,1648,Cairo,5061,Berlin,5440,Honolulu,5 549,Cape,7375,Chicago,7793,Caracas,10167,BA,11472 Honolulu,Chicago,4250,HK,5549,Caracas,6013,Calcutt a,7047,Berlin,7309,BA,7561,Cairo,8838,Cape,11534 ; run; I would like to group these cities such that all cities in a group are within 5000 miles of each other. I am looking for the least possible number of groupings that can be attained. The output I am looking for is like below: City Group HK 1 Calcutta 1 BA 2 .... and so on. Can PROC CLUSTER be used for this purpose? Thank you in advance for any suggestions. Sid |
|
|
||||
|
||||
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Grouping based on distances | Sid N | Newsgroup comp.soft-sys.sas | 0 | 12-21-2008 12:51 AM |
| Re: Grouping based on distances | Arthur Tabachneck | Newsgroup comp.soft-sys.sas | 0 | 12-20-2008 11:06 PM |
| Re: grouping features based on position | David L Cassell | Newsgroup comp.soft-sys.sas | 0 | 05-31-2006 05:27 AM |
| Re: grouping features based on position | nospam@HOWLES.COM (Howard Schreier | Newsgroup comp.soft-sys.sas | 0 | 05-27-2006 01:00 AM |
| Re: grouping features based on position | Duck-Hye Yang | Newsgroup comp.soft-sys.sas | 0 | 05-26-2006 07:00 PM |