Skip to content

Cluster analysis: k-means, latent class and how to segment survey data

Cluster analysis is a group of statistical methods that sort cases, such as survey respondents, so that members of a group are more similar to each other than to members of other groups. Market researchers use it to build customer segments, usually with k-means clustering, hierarchical clustering or latent class analysis.

Tracey Stuart
Tracey Stuart

Global VP Analysis & Insights · Updated August 13, 2026

Part of the guide Customer segmentation analysis

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?

MethodHow it worksBest forWatch out for
K-means clusteringPlaces k centers, assigns each case to the nearest, moves the centers, repeatsLarge samples, numeric or standardized variablesYou set k in advance; results depend on starting centers
Hierarchical clusteringMerges the closest cases step by step into a tree (dendrogram)Small to medium samples; seeing how many groups existSlow on large samples; early merges cannot be undone
Latent class analysisFits a statistical model with hidden classes; each person gets a probability for each classCategorical or mixed answers; formal model comparisonSlower to run; classes can be over-read
Two-step approachesReduce or pre-group the data first, then cluster the resultMany variables or very large filesMore 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.

  1. 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.
  2. 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.
  3. 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.
  4. 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:

  1. Assign: put each respondent in the cluster whose center (centroid) is nearest, using straight-line (Euclidean) distance.
  2. 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.

RespondentxyDistance to ADistance to BAssigned to
R11.2−1.00.001.50A
R20.9−1.40.501.71A
R30.30.21.500.00B
R4−0.91.23.041.56B
R5−0.40.62.260.81B
R6−1.10.42.691.41B

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 squaresReduction from previous k
111,990n/a
29,35022.0%
37,68017.9%
46,42016.4%
55,9107.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:

ClassesLog-likelihoodParametersBICSmallest class
2−8,4202517,01741%
3−8,1903816,64922%
4−8,0505116,46214%
5−8,0056416,4644%
6−7,9757716,4963%

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.

Frequently asked questions

Is k-means clustering the same as cluster analysis?

No. K-means clustering is one method of cluster analysis. Cluster analysis is the wider family, which also includes hierarchical clustering, latent class analysis and two-step approaches. K-means is popular because it is fast and simple, but it suits only numeric, standardized inputs.

How many respondents do you need for cluster analysis?

There is no fixed minimum, but you need enough people in the smallest segment to profile it. If you expect a segment of 10% and want at least 100 people in it, you need roughly 1,000 respondents in total, before any splits by market or wave.

Can you add new respondents to existing clusters?

Yes. With k-means, assign each new respondent to the nearest saved centroid, using the same standardization as the original run. With latent class analysis, score new respondents with the saved model. Many teams also build a short typing tool of a few questions for future surveys.

What is the difference between latent class analysis and k-means?

Latent class analysis is a statistical model that estimates each person's probability of belonging to each class and works with categorical answers. K-means assigns each person to one nearest center using distances on numeric variables and gives no formal fit statistic for comparing solutions.

See your segments in mTab.

Bring a segmented study or tracker. We'll show you segment reads with significance testing, and what drives each segment.

Book a demo