On Tue, 2007-05-22 at 00:35 +0000, [EMAIL PROTECTED] wrote: > I'd like to get a measure of goodness of fit for a heirarchical > clustering result from hclust. Something that would indicate the > extent to which the dendrogram accurately represents the original > dissimilarity matrix. Is there an easy way to do this? > > Or, does anyone have code for computing distances between nodes given > an hclust structure? So far, my searches have come up dry. > > -- David Hinds
Try ?cophenetic which calculates the cophenetic distances of a hierarchical cluster analysis. The example on that help page shows how to use the function to get the correlation between the original distances and cophenetic distances. HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [t] +44 (0)20 7679 0522 ECRC [f] +44 (0)20 7679 0565 UCL Department of Geography Pearson Building [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street London, UK [w] http://www.ucl.ac.uk/~ucfagls/ WC1E 6BT [w] http://www.freshwaters.org.uk/ %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% ______________________________________________ R-help@stat.math.ethz.ch 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.