Tal Galili
2010-Feb-21 12:17 UTC
[R] How to: Compare Two dendrograms (Hierarchical Clusterings) ?
Hello all, I wish to compare two dendrograms (representing Hierarchical Clusterings). My problems are several: 1) how do I manually create a dendrogram object ? That is, how can I reconstruct it as an "hclust" object that creates such a dendrogram, when all I have is the dendrogram image (but don't have the underlaying distance matrix that produced it) ? I see that there is a function called "as.dendrogram" But I wasn't able to find an example on how to use it. 2) Assuming that I have to hclust (or dendrogram ) objects, how can I compare them ? After some searching and asking, I found this article: http://www.jstor.org/pss/2288117 And a few others that cite it, that gives ideas on how to do this. But I wasn't able to come a cross a R implementation of it. Is there ? Many thanks, Tal ----------------Contact Details:------------------------------------------------------- Contact me: Tal.Galili@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- [[alternative HTML version deleted]]
Ricardo Marcacini
2010-Feb-26 12:09 UTC
[R] How to: Compare Two dendrograms (Hierarchical Clusterings) ?
Hi, To compare two dendrogamas, you can use a measure of correlation between the cophenetic matrices. Example: mdist <- dist(iris[,-5], method="euclidean") # dendrogram from cluster 1 (single-linkage) hc1 <- hclust(mdist, method="single") plot(hc1) # dendrogram from cluster 2 (complete-linkage) hc2 <- hclust(mdist, method="complete") plot(hc2) # correlation cor(cophenetic(hc1),cophenetic(hc2)) For a confidence level, use the "Mantel Test" from package vegan. mantel(cophenetic(hc1), cophenetic(hc2)) Good Look.