Date: Tue, 31 Jul 2001 11:11:43 -0400
Reply-To: Arthur J Kendall <KendallA@GAO.GOV>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Arthur J Kendall <KendallA@GAO.GOV>
Subject: Re: euclid distance again
Content-Type: text/plain; charset=US-ASCII
your example data shows only 1 variable for distances but each case has a distance from every other case.
What do you mean by "Euclidean distance" when there is only 1 dimension?
With a single dichotomous variable the Euclidean and city block distances are the same.
the Euclidean distance is the sqrt of the sum of squared distances on each of the dimensions.
d(1,2)=sqrt( ((a1-a2)**2) + ((b-b2)**2) + ((c1-c2)**2) ...)
the city block distance is the sum of the absolute distances on each of the dimensions.
for the following matrix is for group 1.
for the first row (across)
for 1 vs 1 the distance is 0
for 1 vs 2 the distance is 0
for 1 vs 3 the distance is 0
1 2 3 4 5
1) 0 0 0 1 1
2 ) 0 0 0 1 1
3 ) 0 0 0 1 1
4) 1 1 1 0 0
5) 1 1 1 0 0
lets say you have 30 subjects that would give you a 30 by 30 matrix with the upper & lower triangles equal to each other.
I don't know if PROXIMITIES will work with only 1 variable but if it does you could do the whole 30 by 30 matrix and just copy the submatrices you are interested in. (1 to 5)by (1 to 5) for the first group (6 to 9) by (6 to 9 ) for the second group ...
numeric subject (f3)
compute subject= (10 * grade) + pupil.
PROXIMITIES sex /MEASURE = Euclid /id =subject.
>>> Anja Langefeld <langefeld@TM.TNO.NL> 07/31/01 10:20AM >>>
Hello,
I will try to explain a bit more clearly.
The issue is this: Let's say I have five groups (e.g. grade school
years) of unequal size . The members of each group may be
divided into sex (male, female) (see the example matrix below). THe
question is what is the euclid distance of each pupil from the others
in his or her grade year in terms of the variable "sex"? Is it possible
to allow SPSS to compute the euclid distance for each pupil or am I
resigned to do it by hand?
grade pupil sex euclid
1 1 1 ?
1 2 1 ?
1 3 1 ?
1 4 0 ?
1 5 0 ?
2 1 1 ?
2 2 0 ?
2 3 0 ?
2 4 0 ?
etc.
greetings Anja