Re: [R] Help with Mahalanobis

From: Thomas Petzoldt <>
Date: Thu 14 Jul 2005 - 03:11:17 EST


a proposed solution of Bill Venables is archieved on the S-News mailing list:

and if I remember it correctly (and if the variance matrix is estimated from the data), another similar way is simply to use the Euclidean distance of rescaled scores of a pricipal component analysis, e.g.:


dat <- iris[1:4] # without the species names

z <- svd(scale(dat, scale=FALSE))$u
cl <- hclust(dist(z), method="ward")
plot(cl, labels=iris$Species)

#### or alternatively: ####

pc <- princomp(dat, cor=FALSE)

pcdata <-$scores)) cl <- hclust(dist(pcdata), method="ward") plot(cl, labels=iris$Species)

Hope it helps!

Thomas P. mailing list PLEASE do read the posting guide! Received on Thu Jul 14 03:24:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:38 EST