liveBook · Manning

Hclust() function

As explained in Statistics Slam Dunk

The hclust() function in base R performs hierarchical clustering from a dissimilarity object and a clustering method.

The base R hclust() function answers a practical segmentation question: which NBA draft selections have similar win-share profiles? It builds hierarchical clusters from a distance matrix and a chosen clustering method. section 3.9

The function works in a clear sequence:

  • Begin with 30 observations, assigning each record to its own cluster. section 3.9
  • Merge the most similar clusters repeatedly until all observations form one cluster. section 3.9

Clustering NBA draft selections

After aggregating win shares by first-round pick, calculate Euclidean distances with dist(draft_clust_final, method = "euclidean"). Complete linkage compares the maximum distance between points in different clusters. The dendrogram then shows when clusters merge at different similarity levels. section 3.9

How Statistics Slam Dunk covers it

How deep it goes
Explains initialization, repeated merging, complete linkage, and dendrogram visualization, but defers alternative methods beyond noting their existence.
Examples
Demonstrates NBA first-round pick numbers and win shares, Euclidean distance calculations, a complete-linkage call, and a two-cluster dendrogram.
What it assumes
Assumes a prepared observation table and distance matrix while demonstrating Euclidean distance calculations from zero.
What you can do after
Evaluate hierarchical clusters by creating an hclust object, plotting its dendrogram, and selecting groups with rect.hclust().
How it connects
Connects Euclidean distance, dissimilarity matrices, complete linkage, hierarchical clustering, dendrograms, and cluster selection.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.