In hierarchical clustering procedure, a distance matrix is used to construct a dendrogram with an appropriate method of clustering. In the process of constructing a dendrogram, a cophenetic matrix is computed. I understand that such a cophenetic matrix is used to assess clustering consistency.

How can I use a cophenetic matrix as such to plot the dendrogram?

  • 1
    $\begingroup$ A cophenetic matrix would be a distance matrix wherein original pairwise distances between the objects are replaced by the computed distances between their clusters at the time of these clusters' merge. Now, most hierarchical clustering programs do not construct such a matrix (no need for) and they plot dendrogram out of another source (such as agglomeration history protocol). $\endgroup$
    – ttnphns
    Commented Jun 20, 2014 at 6:22
  • 1
    $\begingroup$ P.S. You surely can use that matrix to build the dendrogram, but it is cumbersome to do because a step number is not written there! $\endgroup$
    – ttnphns
    Commented Jun 20, 2014 at 6:27
  • $\begingroup$ @ttnphns what do you mean by step number? Is it height or the merge groups? $\endgroup$
    – Crops
    Commented Jun 20, 2014 at 6:49
  • $\begingroup$ I have a cophenetic matrix derived from an iterative ordering method of clustering. I would like to use that for plotting a dendrogram. $\endgroup$
    – Crops
    Commented Jun 20, 2014 at 6:51
  • 1
    $\begingroup$ Step number - step of agglomeration in hierarchical clustering. Ordinal number of bars (not branches) on dendrogram. $\endgroup$
    – ttnphns
    Commented Jun 20, 2014 at 7:10

1 Answer 1


You can just recreate the plot using hclust on the cophenetic of the object, and it would get you what you want (the method used in hclust doesn't matter).

dat <- (matrix(rnorm(100), 4, 24))
dat_dist <- dist(dat)
hc1 <- hclust(dat_dist)


hc2 <- hclust(cophenetic(hc1), method = "complete")
hc3 <- hclust(cophenetic(hc1), method = "single")
hc4 <- hclust(cophenetic(hc1), method = "ave")

par(mfrow = c(1,4))

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.