Dendrogram Explained: How to Make, Read and Report Hierarchical Clustering
A dendrogram shows how observations merge into clusters step by step, so you can see natural groups in samples or variables without defining them in advance. This guide explains how to read the tree, how to choose distance and linkage, how to decide the number of clusters, and how to report the result in APA7.
What is a dendrogram?
A dendrogram is the tree produced by hierarchical clustering. Each leaf is an observation (a sample, patient or gene). At the bottom every observation is its own cluster. At each step the two closest clusters are merged, and the height of the join records how far apart they were. Hierarchical clustering is a standard tool for gene expression and other omics data (Eisen et al., 1998), patient stratification and ecological data.
How to read a dendrogram
- Low joins mean similar observations; high joins mean dissimilar ones.
- Cutting the tree at a chosen height gives clusters: draw a horizontal line and count the vertical branches it crosses. The generator draws the cut as a dashed line and colours the clusters.
- Horizontal order of leaves is partly arbitrary. Two leaves next to each other are not necessarily similar; only the height of the join tells you the distance.
Choose a distance and a linkage
The distance defines similarity between observations. Euclidean distance on standardized variables is the usual default; correlation-based distance suits profiles such as gene expression. The linkage defines the distance between clusters. Ward’s method (Ward, 1963) minimizes the increase in within-cluster variance and tends to give compact, similar-sized clusters. Complete linkage gives tight clusters, average linkage is a compromise, and single linkage can chain observations into long straggling clusters. Standardize variables first if they have different units.
How many clusters? Silhouette width
The tree itself does not tell you how many clusters there are. The silhouette width (Rousseeuw, 1987) compares, for each observation, its distance to its own cluster with its distance to the nearest other cluster; values near 1 mean well-clustered, near 0 mean borderline. The Dendrogram Generator computes the mean silhouette width for 2 to 10 clusters and uses the best one unless you set a number yourself.
Does your data cluster at all? Cophenetic correlation and Hopkins
Two checks protect against over-interpretation. The cophenetic correlation (Sokal & Rohlf, 1962) correlates the original distances with the distances implied by the tree; values above about .75 mean the tree represents the data faithfully. The Hopkins statistic (Hopkins & Skellam, 1954) tests clustering tendency: about .50 means the data are spatially random, and values above about .75 suggest real clusters. If you supply a known-group column, the generator also reports the adjusted Rand index (Hubert & Arabie, 1985) to show how well clusters match known groups.
Step by step: make a dendrogram in StatFas
- Open the Dendrogram Generator.
- Load the example data (30 invented tumour samples with ten gene expression values), paste a table, or upload a CSV, Excel or SPSS file with numeric columns, an optional label column and an optional known-group column.
- Choose whether to cluster observations or variables, the distance (Euclidean, Manhattan or 1 − Pearson correlation), the linkage (Ward, complete, average or single) and whether to standardize. Leave Clusters to cut at 0 to use the best silhouette width.
- Run the analysis to get the tree, cut, cluster sizes, silhouette widths, cophenetic correlation, Hopkins statistic and APA7 interpretation.
- Style the figure, then log in (free) to download it, the tables and a Word report.
The tutorial repeats the analysis in SPSS, R, Python and MATLAB.
How to report it in APA7
State the distance, the linkage, how the number of clusters was chosen and the quality measures. Example wording (illustrative numbers):
Common mistakes to avoid
- Clustering unstandardized variables with different units.
- Treating clusters as proof of real groups. Hierarchical clustering always returns a tree, even for random data.
- Reading similarity from the horizontal position of leaves.
- Choosing single linkage by default and getting chained clusters.
Frequently asked questions
Which linkage method should I choose?
Ward’s method is a good default for compact clusters on standardized data. Try average or complete linkage as a check; if conclusions change a lot, the clusters are not robust.
What is the difference between hierarchical clustering and k-means?
Hierarchical clustering builds a tree and does not need the number of clusters in advance. k-means needs k up front and is faster for very large data.
Can I cluster variables instead of samples?
Yes. Transpose the table so variables become rows, or cluster on 1 − |r| distance to group related variables. See also the correlogram.
Can I make a dendrogram for free?
Yes. The StatFas generator is free to run in your browser; a free account is needed only to download results.
Related tools, guides and tutorials
- Tutorial: dendrogram in StatFas, SPSS, R and Python
- PCA calculator
- PCA tutorial
- Principal component analysis explained
- Network analysis calculator
- Network analysis tutorial
- Heatmap maker
- Heatmap tutorial
- Mantel network analysis explained
- One-way ANOVA calculator
- PCA Biplot Generator
- Parallel Coordinates Plot Generator
- 3D Scatter Plot Generator
- All tutorials
- All blog posts
References
- American Psychological Association. (2020). Publication manual of the American Psychological Association (7th ed.).
- Eisen, M. B., Spellman, P. T., Brown, P. O., & Botstein, D. (1998). Cluster analysis and display of genome-wide expression patterns. Proceedings of the National Academy of Sciences, 95(25), 14863–14868.
- Hopkins, B., & Skellam, J. G. (1954). A new method for determining the type of distribution of plant individuals. Annals of Botany, 18(2), 213–227.
- Hubert, L., & Arabie, P. (1985). Comparing partitions. Journal of Classification, 2(1), 193–218.
- Rousseeuw, P. J. (1987). Silhouettes: A graphical aid to the interpretation and validation of cluster analysis. Journal of Computational and Applied Mathematics, 20, 53–65.
- Sokal, R. R., & Rohlf, F. J. (1962). The comparison of dendrograms by objective methods. Taxon, 11(2), 33–40.
- Ward, J. H. (1963). Hierarchical grouping to optimize an objective function. Journal of the American Statistical Association, 58(301), 236–244.