At 5:00 PM +0100 11/27/08, Claudia Beleites wrote:
Hi Rodrigo,
afaik, (1 - r_Pearson)/2 is used rather than 1 - r_Pearson. This gives a
distance measure ranging between 0 and 1 rather than 0 and 2. But after all,
dies does not change anything substantial.
see e.g. Theodoridis & Koutroumbas: Pattern Recognition.
I didn't know of the proxy package, but the calculation it straightforward
(though a bit wasteful I suspect: first the whole matrix is produced, and
as.dist cuts it down again to a triangular matrix):
as.dist (0.5 - cor (t(x) / 2))
Take care wheter you want to use x or t(x).
HTH Claudia
From the law of cosines, d = sqrt(2(1-r)) is a somewhat more
appropriate transformation of a Pearson correlation to a distance.
Although this is monotonically related to the (1-r)/2, by taking the
square root it will lead to somewhat different solutions in
clustering.
Bill
--
William Revelle http://personality-project.org/revelle.html
Professor http://personality-project.org/personality.html
Department of Psychology http://www.wcas.northwestern.edu/psych/
Northwestern University http://www.northwestern.edu/
Attend ISSID/ARP:2009 http://issid.org/issid.2009/
______________________________________________
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.