[R] Goodness of fit for hclust?

Gavin Simpson gavin.simpson at ucl.ac.uk
Tue May 22 09:36:03 CEST 2007


On Tue, 2007-05-22 at 00:35 +0000, dhinds at sonic.net 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/
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list