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 (June 2010)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 3 Jun 2010 08:06:26 -0400
Reply-To:     Josh <student_t@YMAIL.COM>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Josh <student_t@YMAIL.COM>
Subject:      Distance calculation and Output

Hi, I hope someone can help me with this.

I have information of two groups and I wish to calculate all Euclidian distances between the obs. Example:

Data

ID Group V1 V2 V3 1 1 98 16 90 2 1 41 49 78 3 1 26 89 47 4 2 3 71 68 5 2 52 32 94 6 2 87 57 86

So, for each combination of ID from Group 1 and ID from Group 2 I wish to calculate the Euclidean distance Distance = SQRT{ (V1(1)-V1(2))^2 + (V2(1)-V2(2))^2 + (V3(1)-V3(2))^2}

The type of Output I wish to have is :

ID1 (Group) ID2 (Group) Distance 1 (1) 4 (2) 67.0373 1 (1) 5 (2) 63.25346 1 (1) 6 (2) 62.68174 2 (1) 4 (2) 78.05127 2 (1) 5 (2) 63 2 (1) 6 (2) 106.4472 3 (1) 4 (2) 66.16646 3 (1) 5 (2) 59.74111 3 (1) 6 (2) 99.42334

(Column 2 and 3 -(Group) are not necessary)

thanks in advance!

JJ.

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


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