Cluster Analysis Using SPSS
Cluster Analysis Using SPSS
I have never had research data for which cluster analysis was a technique I thought
appropriate for analyzing the data, but just for fun I have played around with cluster analysis. I
created a data file where the cases were faculty in the Department of Psychology at East Carolina
University in the month of November, 2005. The variables are:
Name -- Although faculty salaries are public information under North Carolina state law, I
though it best to assign each case a fictitious name.
Salary annual salary in dollars, from the university report available in OneStop.
FTE Full time equivalent work load for the faculty member.
Rank where 1 = adjunct, 2 = visiting, 3 = assistant, 4 = associate, 5 = professor
Articles number of published scholarly articles, excluding things like comments in
newsletters, abstracts in proceedings, and the like. The primary source for these data was the
faculty members online vita. When that was not available, the data in the Universitys
Academic Publications Database was used, after eliminating duplicate entries.
Experience Number of years working as a full time faculty member in a Department of
Psychology. If the faculty member did not have employment information on his or her web
page, then other online sources were used for example, from the publications database I
could estimate the year of first employment as being the year of first publication.
In the data file but not used in the cluster analysis are also
ArticlesAPD number of published articles as listed in the universitys Academic Publications
Database. There were a lot of errors in this database, but I tried to correct them (for example,
by adjusting for duplicate entries).
Sex I inferred biological sex from physical appearance.
Click Statistics and indicate that you want to see an Agglomeration schedule with 2, 3, 4, and 5
cluster solutions. Click Continue. Click Plots and indicate that you want a Dendogram and a
vertical Icicle plot with 2, 3, and 4 cluster solutions. Click Continue.
ClusterAnalysis-SPSS
2
Click Method and indicate that you want to use the Between-groups linkage method of
clustering, squared Euclidian distances, and variables standardized to z scores (so each variable
contributes equally). Click Continue. Click Save and indicate that you want to save, for each
case, the cluster to which the case is assigned for 2, 3, and 4 cluster solutions. Click Continue,
OK.
SPSS starts by standardizing all of the variables to mean 0, variance 1. This results in all the
variables being on the same scale and being equally weighted.
3
In the first step SPSS computes for each pair of cases the squared Euclidian distance
v 2
the squared difference between the score on variable i for the one case (Xi) and the score on
variable i for the other case (Yi). The two cases which are separated by the smallest Euclidian
distance are identified and then classified together into the first cluster. At this point there is one
cluster with two cases in it.
Next SPSS re-computes the squared Euclidian distances between each entity (case or cluster)
and each other entity. When one or both of the compared entities is a cluster, SPSS computes
the averaged squared Euclidian distance between members of the one entity and members of the
other entity. The two entities with the smallest squared Euclidian distance are classified together.
SPSS then re-computes the squared Euclidian distances between each entity and each other
entity and the two with the smallest squared Euclidian distance are classified together. This
continues until all of the cases have been clustered into one big cluster.
Look at the Agglomeration Schedule. On the first step SPSS clustered case 32 with 33. The
squared Euclidian distance between these two cases is 0.000. At stages 2-4 SPSS creates three
more clusters, each containing two cases. At stage 5 SPSS adds case 39 to the cluster that
already contains cases 37 and 38. By the 43rd stage all cases have been clustered into one
entity.
Agglomeration Schedule
Cluster Combined Coefficients Stage Cluster First Appears Next Stage
Stage
Cluster 1 Cluster 2 Cluster 1 Cluster 2 Cluster 1 Cluster 2
1 32 33 .000 0 0 9
2 41 42 .000 0 0 6
3 43 44 .000 0 0 6
4 37 38 .000 0 0 5
5 37 39 .001 4 0 7
6 41 43 .002 2 3 27
7 36 37 .003 0 5 27
8 20 22 .007 0 0 11
9 30 32 .012 0 1 13
10 21 26 .012 0 0 14
11 20 25 .031 8 0 12
12 16 20 .055 0 11 14
13 29 30 .065 0 9 26
14 16 21 .085 12 10 20
15 11 18 .093 0 0 22
16 8 9 .143 0 0 25
4
17 17 24 .144 0 0 20
18 13 23 .167 0 0 22
19 14 15 .232 0 0 32
20 16 17 .239 14 17 23
21 7 12 .279 0 0 28
22 11 13 .441 15 18 29
23 16 27 .451 20 0 26
24 3 10 .572 0 0 28
25 6 8 .702 0 16 36
26 16 29 .768 23 13 35
27 36 41 .858 7 6 33
28 3 7 .904 24 21 31
29 11 28 .993 22 0 30
30 5 11 1.414 0 29 34
31 3 4 1.725 28 0 36
32 14 31 1.928 19 0 34
33 36 40 2.168 27 0 40
34 5 14 2.621 30 32 35
35 5 16 2.886 34 26 37
36 3 6 3.089 31 25 38
37 5 19 4.350 35 0 39
38 1 3 4.763 0 36 41
39 5 34 5.593 37 0 42
40 35 36 8.389 0 33 43
41 1 2 8.961 38 0 42
42 1 5 11.055 41 39 43
43 1 35 17.237 42 40 0
Look at the Vertical Icicle. For the two cluster solution you can see that one cluster consists of
ten cases(Boris through Willy, followed by a white column). These were our adjunct (part-time)
faculty (excepting one) and the second cluster consists of everybody else.
For the three cluster solution you can see that the cluster of adjunct faculty remains intact but
the other cluster is split into two. Deanna through Mickey were our junior faculty and Lawrence
through Rosalyn our senior faculty
For the four cluster solution you can see that one case (Lawrence) forms a cluster of his own.
5
Look at the Dendogram. It displays essentially the same information that is found in the
agglomeration schedule but in graphic form.
Look back at the data sheet. You will find three new variables. CLU2_1 is cluster membership
for the two cluster solution, CLU3_1 for the three cluster solution, and CLU4_1 for the four cluster
solution. Remove the variable labels and then label the values for CLU2_1
6
and CLU3_1.
The two group solution: Adjuncts vs others. Let us see how the two clusters in the two
cluster solution differ from one another on the variables that were used to cluster them.
The output shows that the cluster Adjuncts has lower mean salary, FTE, ranks, published
articles, and years experience.
7
CLU2_1 N Mean Std. Deviation
Others 34 60085 18665.11397
Salary
Adjuncts 10 5956 2101.01288
Others 34 1.0000 .00000
FTE
Adjuncts 10 .3750 .13176
Others 34 3.53 1.134
Rank
Adjuncts 10 1.00 .000
Others 34 14.91 16.539
Articles
Adjuncts 10 1.90 4.771
Others 34 12.79 1.335
Experience
Adjuncts 10 4.70 10.688
The three cluster solution: Senior faculty, adjuncts, others. Now compare the three
clusters from the three cluster solution. Use One-Way ANOVA.
8
ANOVA
Now, just for fun, let us try a little multiple regression. We want to see how faculty salaries are
related to FTEs, rank, number of published articles, and years of experience.
Ask for part and partial correlations and for Casewise diagnostics for All cases.
The output shows that each of our predictors is has a medium to large positive zero-order
correlation with salary, but only FTE and rank have significant partial effects. In the Casewise
10
Diagnostic table you are given for each case the standardized residual (I think that any whose
absolute value exceeds 1 is worthy of inspection by the persons who set faculty salaries), the
actual salary, the salary predicted by the model, and the difference, in $, between actual salary
and predicted salary.
If you split the file by sex and repeat the regression analysis you will see some interesting
differences between the model for women and the model for men. The partial effect of rank is
much greater for women than for men. For men the partial effect of articles is positive and
significant, but for women it is negative. That is, among our female faculty, the partial effect of
publication is to lower ones salary.
Clustering Variables
Cluster analysis can be used to cluster variables instead of cases. In this case the goal is
similar to that in factor analysis to get groups of variables that are similar to one another. Again,
I have yet to use this technique in my research, but it does seem interesting.
I have saved, annotated, and placed online the statistical output from the analysis. You may
wish to look at it while reading through the remainder of this document.
Look at the proximity matrix. It is simply the intercorrelation matrix. We start out with each
variable being an element of its own. Our first step is to combine the two elements that are
closest that is, the two variables that are most well correlated. As you can from the proximity
matrix, that is color and aroma (r = .909). Now we have six elements one cluster and five
variables not yet clustered.
In Stage 2, we cluster the two closest of the six remaining elements. That is size and alcohol
(r = .904). Look at the agglomeration schedule. As you can see, the first stage involved
clustering variables 5 and 6 (color and aroma), and the second stage involved clustering variables
2 and 3 (size and alcohol).
12
In Stage 3, variable 7 (taste) is added to the cluster that already contains variables 5 (color)
and 6 (aroma).
In Stage 4, variable 1 (cost) is added to the cluster that already contains variables 2 (size)
and 3 (alcohol). We now have three elements two clusters, each with three variables, and one
variable not yet clustered.
In Stage 5, the two clusters are combined, but note that they are not very similar, the similarity
coefficient being only .038. At this point we have two elements, the reputation variable all alone
and the six remaining variables clumped into one cluster.
The remaining plots show pretty much the same as what I have illustrated with the proximity
matrix and agglomeration schedule, but in what might be more easily digested format.
I prefer the three cluster solution here. Do notice that reputation is not clustered until the very
last step, as it was negatively correlated with the remaining variables. Recall that in the
components and factor analyses it did load (negatively) on the two factors (quality and cheap
drunk).
Karl L. Wuensch
East Carolina University
Department of Psychology
Greenville, NC 27858-4353
17-January-2016