[R] PAM clustering (using triangular matrix)
quesadaj at psych.colorado.edu
Tue Jan 9 23:42:30 CET 2001
I'm trying to use a similarity matrix (triangular) as input for pam() or
fanny() clustering algorithms.
The problem is that this algorithms can only accept a dissimilarity
matrix, normally generated by daisy().
However, daisy only accept 'data matrix or dataframe. Dissimilarities
will be computed between the rows of x'.
Is there any way to say to that your data are already a similarity
In Kaufman and Rousseeuw's FORTRAN implementation (1990), they showed an
option like this one:
"Maybe you already have correlations coefficients between variables.
Your input data constist on a lower triangular matrix of pairwise
correlations. You wish to calculate dissimilarities between the
But I couldn't find this alternative in the R implementation.
I can not use foo <- as.dist(foo), neither daisy(foo...) because
"Dissimilarities will be computed between the rows of x", and this is
what I mean.
You can easily transform your similarities into dissimilarities like
this (also recommended in Kaufman and Rousseeuw ,1990):
foo <- (1 - abs(foo)) # where foo are similarities
But then pam() will complain like this:
" x is not of class dissimilarity and can not be converted to this
Can anyone help me? I also appreciate any advice about other clustering
algorithms that can accept this type of input.
Thanks a lot in advance,
Dept. of Experimental Psychology,
University of Granada, Spain.
Visitor researcher at the
institute of cognitive science
University of Colorado, Boulder, Us.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 501 bytes
Desc: Card for Jose Quesada
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20010109/a0e0927e/quesadaj.vcf
More information about the R-help