Learn R Programming

cluster (version 1.12.0)

coef.hclust: Agglomerative Coefficient for 'hclust' Objects

Description

Computes the agglomerative coefficient, measuring the clustering structure of the dataset.

For each observation i, denote by $m(i)$ its dissimilarity to the first cluster it is merged with, divided by the dissimilarity of the merger in the final step of the algorithm. The agglomerative coefficient is the average of all $1 - m(i)$. It can also be seen as the average width (or the percentage filled) of the banner plot.

Because it grows with the number of observations, this measure should not be used to compare datasets of very different sizes.

Usage

coef.hclust(object, ...)
## S3 method for class 'hclust':
coef(object, \dots)
## S3 method for class 'twins':
coef(object, \dots)

Arguments

object
an object of class "hclust" or "twins", i.e., typically the result of hclust(.),agnes(.), or
...
currently unused potential further arguments

Value

  • a number specifying the agglomerative (or divisive for diana objects) coefficient as defined by Kaufman and Rousseeuw, see agnes.object $ ac or diana.object $ dc.

Examples

Run this code
data(agriculture)
aa <- agnes(agriculture)
coef(aa) # really just extracts aa$ac
coef(as.hclust(aa))# recomputes
d.a <- dist(agriculture, "manhattan")
 for (m in c("average", "single", "complete")) 
    stopifnot(all.equal(coef(hclust(d.a, method=m)),
                        coef(agnes (d.a, method=m)), tol=1e-13))

Run the code above in your browser using DataLab