You have a survey of 1,500 category buyers with dozens of attitude and behavior questions, and the brand team wants to know what kinds of customers it really has. Splitting by age or region rarely finds groups that think differently; cluster analysis finds them from the answers themselves. This guide compares the methods, walks through k-means clustering step by step and shows how to check that your segments are real. For the full segmentation process, from objectives to rollout, see our guide to customer segmentation analysis.
Key takeaways
- K-means clustering is fast and simple for numeric data; latent class analysis is model-based, handles categorical answers and gives fit statistics.
- Choose your basis variables, clean straight-liners and standardize before you cluster. The inputs decide the segments.
- Pick the number of clusters on the elbow or fit statistics, segment size, stability and sense.
- A cluster solution is only useful once you can profile, name and act on each segment.
What is cluster analysis in market research?
Cluster analysis is unsupervised: there is no outcome to predict, only the question of who resembles whom. In market research it is used most for needs-based and attitudinal segmentation, such as the approach in our psychographic segmentation guide. Teams also use it on usage and purchase data, covered in behavioral segmentation, and to group markets or brands with similar profiles.
Which cluster analysis methods should you know?
| Method | How it works | Best for | Watch out for |
|---|---|---|---|
| K-means clustering | Places k centers, assigns each case to the nearest, moves the centers, repeats | Large samples, numeric or standardized variables | You set k in advance; results depend on starting centers |
| Hierarchical clustering | Merges the closest cases step by step into a tree (dendrogram) | Small to medium samples; seeing how many groups exist | Slow on large samples; early merges cannot be undone |
| Latent class analysis | Fits a statistical model with hidden classes; each person gets a probability for each class | Categorical or mixed answers; formal model comparison | Slower to run; classes can be over-read |
| Two-step approaches | Reduce or pre-group the data first, then cluster the result | Many variables or very large files | More decisions to document |
See what hierarchical clustering is and how to read a dendrogram for that method in depth. A common two-step pattern runs hierarchical clustering on a sample to see how many groups exist, then k-means on the full file.
How do you prepare survey data for clustering?
Most failed segmentations fail here, before the cluster analysis even runs.
- Choose basis variables. These are the questions that define the segments, such as needs or attitudes. Keep demographics out and use them later to describe segments.
- Handle scale use and straight-lining. Remove respondents who give the same answer to every item in a grid. If some people rate everything high, consider centering each respondent’s answers on their own mean so you cluster on priorities, not on generosity.
- Standardize. Convert each variable to a z-score (mean 0, standard deviation 1), so a 0 to 10 question does not outweigh a 1 to 5 question.
- Reduce correlated variables. With 40 statements that overlap heavily, run factor analysis first and cluster on the factor scores. Otherwise, one theme asked ten ways gets ten times the weight.
How does k-means clustering work?
K-means repeats two steps until nothing changes:
- Assign: put each respondent in the cluster whose center (centroid) is nearest, using straight-line (Euclidean) distance.
- Update: move each centroid to the average of the respondents now assigned to it.
What does a worked k-means example look like?
The numbers below are illustrative, not from a real study. Six respondents have standardized scores on two variables: price sensitivity (x) and interest in premium features (y). We want two clusters, and the algorithm picks R1 and R3 as starting centroids: A = (1.2, −1.0) and B = (0.3, 0.2).
Distance is the square root of the squared differences added together. For R5 to centroid B: √((−0.4 − 0.3)² + (0.6 − 0.2)²) = √(0.49 + 0.16) = √0.65 = 0.81.
| Respondent | x | y | Distance to A | Distance to B | Assigned to |
|---|---|---|---|---|---|
| R1 | 1.2 | −1.0 | 0.00 | 1.50 | A |
| R2 | 0.9 | −1.4 | 0.50 | 1.71 | A |
| R3 | 0.3 | 0.2 | 1.50 | 0.00 | B |
| R4 | −0.9 | 1.2 | 3.04 | 1.56 | B |
| R5 | −0.4 | 0.6 | 2.26 | 0.81 | B |
| R6 | −1.1 | 0.4 | 2.69 | 1.41 | B |
Now update the centroids by averaging each cluster’s members:
- A = ((1.2 + 0.9) / 2, (−1.0 + −1.4) / 2) = (1.05, −1.20)
- B = ((0.3 − 0.9 − 0.4 − 1.1) / 4, (0.2 + 1.2 + 0.6 + 0.4) / 4) = (−0.525, 0.60)
The within-cluster sum of squares (each respondent’s squared distance to their centroid, added up) falls from 5.34 to 1.85. On the second pass, R3 is 0.92 from the new B and 1.59 from the new A, so it stays put. No one moves, so the algorithm stops: cluster A is price-sensitive with little interest in premium features, and B is the reverse.
How do you choose the number of clusters?
No single statistic decides how many clusters a cluster analysis should keep; weigh four things together.
- The elbow. Plot the within-cluster sum of squares for each k and look for the point where adding a cluster stops buying much.
- Interpretability. Can you describe each segment in one sentence that a marketer would recognize?
- Size. A segment of 2% is rarely worth a strategy of its own.
- Stability. Rerun with different random starts and on two random halves of the sample. Segments that reappear are real; ones that shuffle are noise.
An illustrative elbow table for 1,200 respondents on 10 standardized variables:
| Clusters (k) | Within-cluster sum of squares | Reduction from previous k |
|---|---|---|
| 1 | 11,990 | n/a |
| 2 | 9,350 | 22.0% |
| 3 | 7,680 | 17.9% |
| 4 | 6,420 | 16.4% |
| 5 | 5,910 | 7.9% |
The gains drop from 16.4% to 7.9% after k = 4, so four clusters is the first candidate. Then check size and stability.
How does latent class analysis work?
Latent class analysis assumes there are a few hidden (latent) groups in the population, and that each group answers the survey questions with its own pattern of probabilities. The model estimates those patterns and each respondent’s probability of belonging to each class. Because it is a model, it works directly on categorical answers, such as yes/no questions, and gives fit statistics for comparing solutions.
The most used fit statistic is the Bayesian information criterion (BIC): −2 × log-likelihood + number of parameters × ln(sample size). Lower BIC is better. An illustrative comparison for 1,200 respondents and 12 yes/no questions:
| Classes | Log-likelihood | Parameters | BIC | Smallest class |
|---|---|---|---|---|
| 2 | −8,420 | 25 | 17,017 | 41% |
| 3 | −8,190 | 38 | 16,649 | 22% |
| 4 | −8,050 | 51 | 16,462 | 14% |
| 5 | −8,005 | 64 | 16,464 | 4% |
| 6 | −7,975 | 77 | 16,496 | 3% |
Four classes has the lowest BIC, but five is almost tied and only adds a 4% class. Treat near-ties as a judgment call, not a verdict. Do not over-interpret membership either: a respondent with probabilities of 0.55 and 0.45 is not firmly in either class, so report how many people are assigned with low certainty.
How do you validate and profile clusters?
Validation asks whether the segments from your cluster analysis are stable and distinct. Profiling asks who they are. Cross every segment against the basis variables, demographics, brand usage and spend, and look for differences that are significant and large enough to matter. Crosstabs and banner tables with weighting and significance testing are the usual way to read those profiles and to compare segment sizes from one wave to the next. To find which attributes move satisfaction in each segment, pair the profiles with key driver analysis.
What are the common mistakes in cluster analysis?
- Clustering on everything. Mixing needs, behaviors and demographics in the basis produces blended segments that are useful for none.
- Skipping standardization. Wider scales dominate the distances and quietly decide the segments.
- Trusting one k-means run. Results depend on the starting centroids. Use many random starts, keep the lowest within-cluster sum of squares and check split halves.
- Picking k from one statistic. An elbow or a BIC minimum is a starting point, not the answer.
- Naming segments before profiling them. Catchy names stick, even when the data says something else.
What should you do next?
Write down the decision the segments must serve, then choose basis variables that matter for it and nothing else. Run k-means or latent class analysis with several values of k, keep the two or three most stable solutions, and profile each before choosing. Once segments are in place, see what drives satisfaction and loyalty by segment so each group gets a different plan.