"The manhattan distance and the Mahalanobis distances are quite different. "
This ought to be a candidate for "fortunes". The way distances are perceived in New York city is very different from that in Calcutta (which is where Professor Prasant Chandra Mahalanobis lived)! Ravi. ____________________________________________________________________ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu ----- Original Message ----- From: Phil Spector <spec...@stat.berkeley.edu> Date: Wednesday, March 3, 2010 4:24 pm Subject: Re: [R] cluster with mahalanobis distance To: Tal Galili <tal.gal...@gmail.com> Cc: r-help@r-project.org, naama <nw...@technion.ac.il> > The manhattan distance and the Mahalanobis distances are > quite different. One of the main differences is that > a covariance matrix is necessary to calculate the Mahalanobis > distance, so it's not easily accomodated by dist. There > is a function in base R which does calculate the Mahalanobis > distance -- mahalanobis(). So if you pass a distance matrix > calculated by mahalanobis() to the clustering function, you'll > get what you want. > - Phil Spector > Statistical Computing Facility > Department of Statistics > UC Berkeley > spec...@stat.berkeley.edu > > > On Wed, 3 Mar 2010, Tal Galili wrote: > > > when you create the distance function to put into the hclust, use: > > > > dist(x, method = "manhattan") > > > > > > Tal > > > > > > > > ----------------Contact > > Details:------------------------------------------------------- > > Contact me: tal.gal...@gmail.com | 972-52-7275845 > > Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il > (Hebrew) | > > www.r-statistics.com (English) > > > ---------------------------------------------------------------------------------------------- > > > > > > > > > > On Wed, Mar 3, 2010 at 9:14 PM, naama <nw...@technion.ac.il> wrote: > > > >> > >> How can I perform cluster analysis using the mahalanobis distance > instead > >> of > >> the euclidean distance? > >> thank you > >> Naama Wolf > >> > >> -- > >> View this message in context: > >> > >> Sent from the R help mailing list archive at Nabble.com. > >> > >> ______________________________________________ > >> R-help@r-project.org mailing list > >> > >> PLEASE do read the posting guide > >> > >> and provide commented, minimal, self-contained, reproducible code. > >> > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help@r-project.org mailing list > > > > PLEASE do read the posting guide > > and provide commented, minimal, self-contained, reproducible code. > > > > ______________________________________________ > R-help@r-project.org mailing list > > PLEASE do read the posting guide > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.