StatLabStudent EditionUser guideGalleryFeaturesAbout

TwoStep cluster analysis

Finds natural groupings in data that mix categorical and continuous variables, and can choose the number of clusters itself using BIC or AIC.

Menu: Analyze → Classify → TwoStep Cluster…

When should I use it?

What are the assumptions?

How do I run it in StatLab?

  1. Move categorical variables and continuous variables to their lists.
  2. Keep the log-likelihood distance (Euclidean works for continuous variables only).
  3. Leave 'Determine automatically' to let BIC (or AIC) and the ratio of distance measures pick the number of clusters, or fix it.
  4. Save the cluster membership to profile the clusters further.

How do I read the output?

OutputMeaning
Auto-ClusteringBIC/AIC for each number of clusters, its changes, and the ratio of distance measures used to pick the solution.
Cluster DistributionSize of each cluster.
CentroidsMean and standard deviation of each continuous variable per cluster.
FrequenciesHow the categories of each categorical variable spread over the clusters.

Worked example

On the practice survey dataset (File → Sample dataset), this command — which the dialog's Paste button also produces — runs the procedure:

PROC glmTwoStep /cat=(group) /cont=(score age) /distance=loglik /n=auto /max=15 /k=3 /criterion=bic /z=YES /save=NO.

Output tables: Auto-Clustering · Cluster Distribution · Centroids · group · Model Summary.

How would I report it in APA style?

A TwoStep cluster analysis (log-likelihood distance) of 2 continuous and 1 categorical variable (N = 150) selected, by BIC and the ratio of distance measures, 3 clusters of 45, 72, 33 cases.

Computed by StatLab's validated procedure code when this page was built. The example only illustrates the steps; choose variables that fit your own research question.

What are common mistakes?

Open StatLab   All guide topics