Cluster analysis

Hierarchical Cluster Analysis

Merges respondents step by step starting from the most similar pairs, stops at the number of clusters you ask for, and profiles each one.

Method summary

Hierarchical cluster analysis builds groups in stages rather than all at once. Every respondent starts as a cluster of one; at each step the two closest clusters merge, and the process continues until all cases sit in a single group. Which pair counts as closest is decided by the linkage criterion: Ward picks the merge that adds least to the within-cluster sum of squares, complete linkage looks at the most distant members of two clusters, average linkage takes the mean distance across all member pairs, and single linkage judges by the closest members. Once that sequence of merges exists, the panel cuts it at the number of clusters you supplied and describes the groups that result. Variables are standardised by default. The backbone of the output is the profile table, holding the variable means per cluster and their departure from the overall average, which is what naming the clusters rests on.

Which research questions does it answer?

  • In a fairly small sample, how many types do respondents fall into and on which variables do those types differ?
  • Can I draw three or four respondent profiles to feed into a qualitative stage?
  • Does the number of segments my theory expects find support in the data?
  • Do the segments stay stable when I change the linkage criterion?

When should you use it?

  • When the number of segments comes from theory, from earlier research or from a practical requirement, since the count is always a parameter here.
  • When at least two numeric variables are available for clustering; the engine will not run with fewer.
  • When the sample is small or moderate, because the merge sequence rests on distances between all pairs of cases.
  • When clusters may not be spherical, since changing the linkage criterion tests sensitivity to different shapes.
  • When you want to try several linkage criteria on the same data and see how stable the resulting segments are.

Required variable types

  • Clustering runs on numeric columns only and at least two are required; their measurement level should be 'scale' on the Variable tab.
  • No outcome variable is selected; every variable contributes equally to the similarity computation.
  • Categorical demographic columns cannot serve as input, though they can describe the resulting clusters.
  • One row per respondent; rows with a missing value on any selected variable are dropped before the analysis begins.

Key assumptions

Similarity is scale-sensitive
The distance between cases sums the contribution of every variable, so a variable with a wide spread leaves its own stamp on the tree.
Merges cannot be undone
Once two clusters join they never separate in later steps. A poor merge made early is carried up through the tree and survives into the final solution.
The linkage criterion suits the structure
Ward tends to produce compact clusters of similar size; single linkage can form long chains, adding cases one at a time to a growing group and leaving one crowded cluster with a few small remainders.
Absence of extreme cases
Every case has to end up in some cluster, so a distant observation either forms a tiny cluster of its own or joins a nearby one and shifts its average.
A balanced set of variables
Where several variables capture the same construct, the similarity computation counts that construct more than once and the merges organise themselves around it.

How YouReply checks these assumptions

  • Similarity is scale-sensitive: Standardisation is on by default and brings the variables onto a shared scale before the merge sequence is built. It can be turned off, in which case judging how far unit differences steer the result falls to the researcher.
  • Merges cannot be undone: The panel does not check this assumption automatically; the researcher evaluates it.
  • The linkage criterion suits the structure: The panel applies the criterion you choose without evaluating it. Because cluster sizes are reported, a very lopsided distribution of sizes, the signature of chaining, is visible there.
  • Absence of extreme cases: No screening for extreme values happens inside this method. When you see a cluster of one or two cases it is worth running outlier detection separately.
  • A balanced set of variables: Correlations among the variables are not examined here. Factor analysis and principal component analysis are offered as separate methods for reducing an item pool to dimensions first.

How the analysis is run

  1. 1Upload your file to the panel with respondents in rows and variables in columns, the first row carrying the variable names.
  2. 2On the Variable tab set the clustering columns to the 'scale' level, declare missing value codes, and build composite scores with derived columns if required.
  3. 3Open the method picker on the Analysis tab and search by name or take the method from the cluster analysis category; with the 'Only ones that fit my data' switch on, methods that do not fit are dimmed with the reason given.
  4. 4Tick the variables in the parameter form and enter the cluster count; the field arrives at 3 and no automatic selection takes place in this method.
  5. 5Choose the linkage criterion. Ward is the default, with complete, average and single also available. Leaving standardisation on is advisable.
  6. 6Start the run. The result lists cluster sizes, the profile table, the quality measures and the per-case cluster labels in collapsible sections.
  7. 7Name the clusters from the profile table and download the tables as Excel. Since no dendrogram is drawn here, the cluster count has to be settled by trying several values and comparing the quality measures.

Statistics and tables produced

Details of the solution
The number of complete observations used, the cluster count applied as the cut point, and the linkage criterion used.
Cluster sizes
The number and share of cases in each cluster. A strongly lopsided distribution suggests the chosen linkage has produced chaining.
Cluster profile table
Variable means per cluster and their departure from the overall average. The content of each cluster is read from these departures.
Quality measures
The silhouette score plus the Calinski-Harabasz and Davies-Bouldin indices. Where they cannot be computed the field comes back empty and no value is produced in its place.
Cluster label per case
The cluster each case was assigned to and the index of the rows retained. The labels can be matched to your own data and used as a grouping variable later.
Summary of the clustering inputs
Which variables entered the analysis and whether standardisation was on. Merge distances and the tree structure are not part of this output.

Effect size and confidence intervals

Silhouette score
Compares how near cases sit to their own cluster against the nearest neighbouring cluster, on a scale from minus one to plus one. It is the primary number for judging how well a solution separates; it drives no automatic choice here, but it is the criterion for comparing cluster counts you try by hand.
Calinski-Harabasz index
Relates between-cluster spread to within-cluster spread, with higher values standing for sharper separation. It is useful for comparing cluster counts or linkage criteria on the same data and does not travel between datasets.
Davies-Bouldin index
The average overlap between clusters and the neighbours they most resemble, where smaller is better. A solution with a high silhouette and a low Davies-Bouldin has its separation supported by two independent measures.

This method returns no confidence interval and performs no significance test between clusters. Cluster means, departures and quality measures are all point estimates, and no standard errors are reported. Because the clusters are derived from the data, a test on the same variables would be circular. Merge distances are not returned either, which closes off the route of choosing a cluster count by looking at the stage where merging accelerates. The practical way to judge stability is to change the cluster count and the linkage criterion and see whether the profile table keeps telling the same story. A formal test of cluster differences calls for a variable that stayed outside the clustering.

Example research question and example result

The numbers below are a representative example, not data from a real study or a real user.

Research question
In a corporate reputation study, do 180 respondents fall into three profiles across four reputation dimensions? (Illustrative example, not real data.)
Variables
Perceived reliability, innovativeness, social responsibility and employee satisfaction: four composite scores from 1 to 7 · 180 complete responses, cluster count 3, Ward linkage, standardisation on
Example result
The clusters held 74 (41.1%), 63 (35.0%) and 43 (23.9%) cases. In the profile table the first cluster sits above the overall average on all four dimensions, peaking on reliability (0.88); the second sits 1.04 points above on innovativeness but 0.61 points below on social responsibility; the third falls below average on all four, lowest on employee satisfaction (-1.19). Quality measures were silhouette 0.41, Calinski-Harabasz 96.8, Davies-Bouldin 0.94. Re-running the same data with average linkage gave sizes of 71, 66 and 43 and left the pattern of the profile table intact.
Interpretation
The three clusters are distinguishable in how they perceive reputation: an audience positive across the board, one that singles out innovativeness while holding back on social responsibility, and one negative throughout. A silhouette of 0.41 places the separation at a moderate level, with boundaries that are not sharp. That the sizes moved by only a few cases and the profiles survived a change of linkage is evidence the solution is stable, and that comparison belongs in the report. Choosing three clusters was a decision taken in the parameter form rather than one drawn from the data: two-cluster and four-cluster solutions should also be run and their quality measures compared, since this method performs no search of its own.

Real output on a sample dataset

The results below were produced by the analysis engine from this data file. Changing the variable changes the research question as well; every run was computed in advance, so the page sends no request to the engine.

Variable examined

General customer survey (synthetic)

A wide survey of three hundred respondents: two and three category grouping variables, continuous measures, a five point ordinal scale, a binary purchase outcome, a four category brand choice, three repeated measurements, paired binary questions, three raters, four price questions and deliberately empty cells.

Rows
300
Columns
respondent_id, gender, education, region, age, income, satisfaction, service_score, price_score, quality_score, loyalty, nps_score, purchased, brand_choice, satisfaction_level, pre_score, post_score, measure_1, measure_2, measure_3, use_before, use_after, use_followup, rater_1, rater_2, rater_3, price_too_cheap, price_cheap, price_expensive, price_too_expensive, feedback_score, followup_rating
Download the dataset as CSV

The data is synthetic: it comes from a fixed random seed, not from a real study. The values below were produced by the analysis engine from this file, so uploading the same file to the panel gives the same results.

Research question: How do three clusters take shape when customers are merged step by step according to their perception scores?

Analyzed variables
satisfaction,service_score,price_score,quality_score,loyalty
Requested number of clusters
3
Linkage criterion
ward
Standardize the variables
true
Cases analyzed
300
Number of clusters
3
linkage
ward
Variables standardized
Yes

Cluster sizes

0
122
1
108
2
70

Cluster profiles

Cluster profiles
ClusterSizeProportionCluster meansDeviation from the overall mean
01220.407--
11080.360--
2700.233--

Cluster quality measures

Silhouette score
0.147
Calinski-Harabasz index (higher is better)
58.10
Davies-Bouldin index (lower is better)
1.82

Computation credits: scipy 1.18.0 · statsmodels 0.14.6 · scikit-learn 1.9.0 · numpy 2.5.1 · pandas 3.0.5 · semopy 2.3.11 · 89fc29a · Data seed: 20260914

How to report the result

After standardising the four reputation dimensions, the 180 respondents were clustered with Ward linkage and the three-cluster solution was examined (74, 63 and 43 cases; silhouette 0.41).

An example sentence close to APA style; the numbers are representative.

When you should not use it

  • The cluster count always comes from the parameter. The automatic search available in k-means does not exist here, so several values have to be tried by hand and compared on the quality measures.
  • The implementation cuts the tree at the requested count and does not return the merge distances; with no dendrogram drawn, the stage at which merging accelerates cannot be inspected in the panel.
  • A merge once made is never undone, so a mistaken decision taken early carries through to the final solution.
  • Because the merge sequence rests on distances between all pairs of cases, the computation grows heavy and the method becomes impractical on very large datasets.
  • Single linkage is prone to chaining and can yield one crowded cluster alongside a few remainders, so the criterion should not be chosen without looking at the size distribution.
  • No significance test or confidence interval accompanies differences between clusters, and categorical variables cannot enter the clustering.

What to use when the assumptions are not met

  • K-Means Cluster AnalysisWhy: When the sample is large, or when the cluster count should be selected automatically on the silhouette score.
  • Exploratory Factor Analysis (EFA)Why: When what needs grouping is the items rather than the respondents; it shows which dimensions the items gather into.
  • Principal Component Analysis (PCA)Why: When many overlapping variables should be condensed into a few components before the similarity computation.
  • One-Way ANOVAWhy: When the clusters are settled and the question is whether they differ on a variable that stayed out of the clustering.

Frequently asked questions

How do I settle on the number of clusters?
In this method the count is always the value you enter, and the field arrives at 3; no search is performed. The practical route is to run several values in turn and compare the quality measures: the solution with the highest silhouette and the lowest Davies-Bouldin index leads on separation. Numbers alone are not enough, though. Each cluster should carry a story of its own in the profile table and stay large enough to address separately in practice. If you want the count chosen from the data, the k-means method performs that search.
Which linkage criterion should I choose?
Ward, the default, is the option used most often with survey data and tends to yield compact clusters of comparable size. Complete linkage judges by the most distant members of two clusters and so produces tight, smaller groups, with average linkage sitting between the two. Single linkage takes the closest member as its criterion and is open to chaining: cases join the growing group one at a time, leaving one crowded cluster and a few small remainders. A good habit in practice is to run two or three criteria at the same cluster count and check whether the profile tables keep their shape; if they do, the solution does not hinge on the criterion.
Do I need to standardise the variables?
You do, and the panel does it by default. Since the similarity computation adds up the contribution of every variable, one with a wide spread steers the merge sequence on its own: putting annual turnover and a seven-point attitude score into the same analysis in raw form means building the clusters on turnover. Turning standardisation off is defensible when all the variables share a format and the differences in spread carry information themselves. If you do turn it off, compare the two runs and see whether the difference changes the story of the clusters.
Where can I see the dendrogram?
No dendrogram is drawn in this method and the merge distances are not returned; the implementation cuts the tree at the count you supply and describes the resulting clusters. The route of picking a cut point by watching where merging accelerates is therefore closed in the panel. Instead, try several cluster counts and compare the quality measures and the profile tables. For work where the tree itself has to be inspected, the drawing has to be produced separately in statistical software that renders a dendrogram for the same linkage criterion.

References

Try it with your own data

The free plan includes 50 analysis runs a month and needs no card.