Date: Mon, 11 Jul 2005 13:08:44 -0400
Reply-To: Talbot Michael Katz <topkatz@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Talbot Michael Katz <topkatz@MSN.COM>
Subject: Re: Cluster analysis: Mahalabonis distance
So it looks like you want to use pairwise Mahalanobis distances to compute
your clusters with. PROC CLUSTER will accept either raw or distance
matrix data as input, so if you compute the Mahalanobis distances
beforehand, you can feed them directly into PROC CLUSTER. I don't know of
a canned procedure or macro that will compute the pairwise matrix for you
on a whole data set, although you might be able to adapt the macro from
the SUGI paper I referenced in my original reply. But this is why I
suggested you look into PROC ACECLUS, because you might want to feed the
output of PROC ACECLUS into one of the clustering procedures (CLUSTER,
FASTCLUS, MODECLUS); I believe that the Euclidean distances between the
canonical variables it computes will look like the Mahalanobis distances
between the original variables (but I don't promise that to be the case).
SAS also provides a macro, %DISTANCE, in the SAS/STAT sample library
(probably in a file called DISTNEW.SAS) that computes many different types
of distance matrices (although not, unfortunately, Mahalanobis).
-- TMK --
"The Macro Klutz"
On Mon, 11 Jul 2005 18:48:21 +0200, I.M. Boerefijn <i.m.boerefijn@HOME.NL>
>thanks for your quick response! I'm not sure if I was specific enough. To
>make it clear I've put an print screen of SPSS on-line:
>You can see the interval measure Squared Euclidean Distance is selected at
>the moment. But instead of that measure, I want to use the Mahalanobis
>distance. SPSS does not provide that.
>The reason why I want it, is that there is multicollinearity among the
>variables I use for the Cluster Analysis.
>"Talbot Michael Katz" <topkatz@MSN.COM> schreef in bericht
>> Hi, Irene.
>> Yes, you can compute Mahalanobis distances (note the spelling) for
>> clusters in SAS. You have several options. There is a SUGI paper that
>> presents a macro to compute the distance between two groups, and gives
>> confidence intervals, ("A Macro for Computing Point Estimates and
>> Confidence Intervals for Mahalanobis Distance,"
>> http://www2.sas.com/proceedings/sugi30/163-30.pdf); it requires the use
>> SAS/IML. After using one of the clustering procedures in SAS/STAT
>> PROC CLUSTER, PROC FASTCLUS), you can obtain Mahalanobis distances
>> clusters (as well as F values and p values) from PROC DISCRIM and PROC
>> If you want to produce a pairwise distance matrix for conducting cluster
>> analysis, you might have to program it yourself, but before you do that,
>> look into PROC ACECLUS. It uses Mahalanobis distance to produce
>> variables that you can use as input to the cluster procedures in SAS, so
>> that may be what you want.
>> Good luck!
>> -- TMK --
>> "The Macro Klutz"
>> On Mon, 11 Jul 2005 15:53:07 +0200, I.M. Boerefijn
>> >I am a user of SPSS. But I encountered a problem with that program. The
>> >Mahalabonis Distance measure is not included for Cluster Analysis. I
>> >wondering if SAS includes this distance measure for conducting Cluster
>> >Thanks in advance,