LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 13 Apr 2006 16:53:33 -0400
Reply-To:     Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject:      Re: Code for higher order neighbor generation
Comments: To: I X <imamx8@GMAIL.COM>

On Thu, 13 Apr 2006 15:55:59 -0400, Imam Xierali <imamx8@GMAIL.COM> wrote:

>Some of you ask about my code for second order neighbor generation in SAS. I >am here pasting it to the email itself, the code works, though it can be >improved. The direct connectivity dataset is from www.correlatesofwar.org. ...

Hi, Imam,

Thanks for sharing your code. I am a bit puzzled by its length and complexity. Maybe you are doing way more than you say what you are doing. Because finding out the "second order neighbors," given a list of the "first order neighbors" can be as simple as below. Or am I missing something?

Cheers, Chang

data neighbors; input from to; cards; 1 2 1 3 2 4 2 5 3 7 4 8 ; run;

proc sql; title "second order neighbors"; select a.from, a.to as through, b.to from neighbors as a, neighbors as b where a.to = b.from order by a.from, b.to ; quit; title; /* on lst second order neighbors

from through to ---------------------------- 1 2 4 1 2 5 1 3 7 2 4 8 */


Back to: Top of message | Previous page | Main SAS-L page