SPSS command: SPSS CLUSTER
Hierarchical cluster analysis in your browser
Hierarchical clustering starts with every case as its own cluster and merges the two closest clusters at each stage until one remains, so you can see the whole grouping history before choosing how many clusters to keep.
Free · No account · Files stay on your device · Updated 18 October 2026
What it tells you
Crosstabs runs SPSS CLUSTER for cases with seven linkage methods and the interval, count and binary measures of PROXIMITIES.
- The order in which cases and clusters merge, and the distance or within-cluster sum of squares at each stage.
- Where a natural cut lies: a sudden jump in the coefficients or a long vertical gap in the dendrogram.
- Which solution in your range is best separated, from the average silhouette for each number of clusters.
- Each case's cluster in every solution from the lowest to the highest number you request.
When to use it
Use it when
- Small to medium files (up to 2,500 cases) where you want to inspect the grouping rather than fix k in advance.
- Grouping stores, products, countries or respondents on a handful of profile variables, with a dendrogram to show stakeholders.
- Binary or count data, using measures such as Jaccard, simple matching or the chi-square measure.
Use something else when
- Thousands of cases: the case-by-case matrix grows with the square of n; use k-means or TwoStep instead.
- Grouping variables rather than cases: this panel clusters cases; for variables use factor analysis or the Distances matrix between variables.
- Mixed continuous and categorical variables: TwoStep handles both directly.
How to run it in Crosstabs
- 01
Open Hierarchical cluster
In Statistics mode, choose Hierarchical cluster (CLUSTER) from the Classify group.
- 02
Choose variables and labels
Tick the Variables to cluster and pick a Label cases by variable so the dendrogram and membership table show names instead of case numbers.
- 03
Pick the cluster method
Choose the Cluster method: Between-groups linkage (default), Within-groups linkage, Nearest neighbor, Furthest neighbor, Centroid clustering, Median clustering or Ward's method.
- 04
Set the measure and standardization
Choose the Data type (Interval, Counts or Binary) and the Measure; Squared Euclidean distance is the default. For interval data pick a Standardize option such as Z scores, by variable or by case.
- 05
Request a range of solutions
Set Solutions from and Solutions to (2 and 5 by default) to save memberships and silhouettes for each number of clusters in that range, then run.
Worked example
Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.
Data
12 synthetic stores (S01–S12) described by weekly visitors (thousands), average basket and percentage of online orders, generated as three store types with normal noise and a fixed seed. The variables are Z-scored, distances are squared Euclidean, the cluster method is Ward's method, and memberships are saved for 2 to 4 clusters.
| Stage | Cluster 1 | Cluster 2 | Coefficients | Stage Cluster First Appears: Cluster 1 | Stage Cluster First Appears: Cluster 2 | Next Stage |
|---|---|---|---|---|---|---|
| 1 | 3 | 9 | 0.024 | 0 | 0 | 8 |
| 2 | 6 | 12 | 0.079 | 0 | 0 | 8 |
| 3 | 2 | 5 | 0.161 | 0 | 0 | 6 |
| 4 | 4 | 10 | 0.355 | 0 | 0 | 7 |
| 5 | 1 | 7 | 0.589 | 0 | 0 | 7 |
| 6 | 2 | 11 | 0.971 | 3 | 0 | 9 |
| 7 | 1 | 4 | 1.701 | 5 | 4 | 11 |
| 8 | 3 | 6 | 2.600 | 1 | 2 | 10 |
| 9 | 2 | 8 | 3.550 | 6 | 0 | 10 |
| 10 | 2 | 3 | 13.647 | 9 | 8 | 11 |
| 11 | 1 | 2 | 33.000 | 7 | 10 | 0 |
For Ward's method the coefficient is the within-cluster sum of squares.
| Clusters | Silhouette measure of cohesion and separation |
|---|---|
| 2 | 0.650 |
| 3 | 0.786 |
| 4 | 0.777 |
| Case | 2 Clusters | 3 Clusters | 4 Clusters |
|---|---|---|---|
| S01 | 1 | 1 | 1 |
| S02 | 2 | 2 | 2 |
| S03 | 2 | 3 | 3 |
| S04 | 1 | 1 | 1 |
| S05 | 2 | 2 | 2 |
| S06 | 2 | 3 | 3 |
| S07 | 1 | 1 | 1 |
| S08 | 2 | 2 | 4 |
| S09 | 2 | 3 | 3 |
| S10 | 1 | 1 | 1 |
| S11 | 2 | 2 | 2 |
| S12 | 2 | 3 | 3 |
How to read it
Ward's method merges the 12 stores in 11 stages. The coefficient grows slowly at first and then jumps: the last three stages raise it to 3.55, 13.65, 33.00, the elbow that suggests stopping before the final merges. Of the 2-, 3- and 4-cluster solutions, 3 clusters have the highest average silhouette (0.786); in the 3-cluster solution the stores fall into groups of 4, 4, 4.
Output tables explained
- Case Processing Summary
- Valid, missing and total N, with the measure used; cases missing any clustering variable are excluded listwise.
- Dendrogram
- The merge tree on SPSS's rescaled distance (0–25). Cut it where the vertical lines are longest to choose the number of clusters.
- Agglomeration Schedule
- Each stage's merged clusters, the coefficient, the stage at which each cluster first appeared and the next stage. For Ward's method the coefficient is the within-cluster sum of squares; otherwise it is the proximity at which the clusters merged.
- Cluster Evaluation
- The SPSS centroid-based silhouette for each requested solution: above 0.5 suggests reasonable structure, below 0.2 little structure.
- Cluster Membership
- One column per solution with each case's cluster number; the CSV export contains every case.
Assumptions and notes
- Results depend heavily on the measure, the linkage and standardization; variables in different units should usually be standardized.
- Ward's, centroid and median clustering are meant for squared Euclidean distance.
- Merges are never undone, so an early poor merge carries through to every later solution.
- A workspace weight is not applied, and a measure that is undefined for some pair (for example a constant case under correlation) stops the analysis.
How the results are validated
Agglomeration coefficients for all seven linkage methods on squared Euclidean distance, between-groups linkage on a Pearson correlation similarity and complete linkage on Z-scored Euclidean distance agree with SciPy 1.18.1 scipy.cluster.hierarchy within 1e-9 on a 36-case reference set (within-groups linkage, which SciPy lacks, against a brute-force NumPy implementation), and cluster memberships are identical. The silhouette matches an independent implementation of the SPSS Cluster Evaluation formulas to 12 decimals, and the dendrogram is checked to span the 0–25 rescaled range. Validation evidence
Questions
Which linkage method should I use?
Ward's method with squared Euclidean distance gives compact clusters of similar size and is a common default for profiling. Between-groups linkage is more robust to outliers; nearest neighbor tends to chain cases into one long cluster.
How do I decide how many clusters to keep?
Look for the stage where the coefficient in the agglomeration schedule jumps, cut the dendrogram at its longest gap, and compare the silhouettes in Cluster Evaluation. Then check the clusters make substantive sense.
How are clusters numbered?
As in SPSS: in the agglomeration schedule a merged cluster keeps the lower case number, and in Cluster Membership clusters are numbered by first appearance in the file, so case 1 is always in cluster 1.
Can I cluster binary yes/no items?
Yes. Set Data type to Binary, choose a measure such as Jaccard or simple matching, and set which values count as Present and Absent.
Is there a case limit?
Yes, 2,500 cases, because the full proximity matrix is held in memory. For larger files use k-means or TwoStep, or cluster a random sample first.
Related procedures
- Distances (Proximities)PROXIMITIES
- K-Means ClusterQUICK CLUSTER
- TwoStep ClusterTWOSTEP CLUSTER
- Multidimensional Scaling (PROXSCAL)PROXSCAL
- Factor AnalysisFACTOR
- Free SPSS alternative: full coverage list
Run Hierarchical Cluster on your own data
Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.
SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.