1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
* After doing an hierarchical cluster analysis, I would like to generate a
* file consisting of cluster centers for three clusters of cases across 50
* variables.

* This file will then be input as initial start centers for a subsequent
* K-means cluster analysis.

* Posted to SPSSX-L by Raynald Levesque on 2004/02/10.

GET FILE='c:\\program files\\spss\\employee data.sav'.
CLUSTER  jobcat jobtime minority educ
  /METHOD BAVERAGE(clid)
  /MEASURE= SEUCLID
  /PRINT NONE
  /PLOT NONE
  /SAVE CLUSTER(4).
SORT CASES BY clid4.
AGGREGATE OUTFILE=*
	/PRESORTED
	/BREAK=clid4
	/jobcat jobtime minority educ=MEAN(jobcat jobtime minority educ).
LIST.
SAVE OUTFILE='c:\\temp\\cluster centers.sav' /RENAME(clid4=cluster_).

GET FILE='c:\\program files\\spss\\employee data.sav'.
QUICK CLUSTER jobcat jobtime minority educ
  /CRITERIA= CLUSTER(4)
  /FILE='c:\\temp\\cluster centers.sav'
  /METHOD=KMEANS(NOUPDATE)
  /PRINT INITIAL .