The ACECLUS Procedure

Example 24.1 Transformation and Cluster Analysis of Fisher Iris Data

(View the complete code for this example.)

The iris data published by Fisher (1936) have been widely used for examples in discriminant analysis and cluster analysis. The sepal length, sepal width, petal length, and petal width are measured in millimeters on 50 iris specimens from each of three species, Iris setosa, I. versicolor, and I. virginica. Mezzich and Solomon (1980) discuss a variety of cluster analyses of the iris data.

In this example PROC ACECLUS is used to transform the iris data, which is available from the Sashelp library, and the clustering is performed by PROC FASTCLUS. Compare this with the example in Chapter 39: The FASTCLUS Procedure. The results from the FREQ procedure display fewer misclassifications when PROC ACECLUS is used.

The following statements produce Output 24.1.1 through Output 24.1.5:

title 'Fisher (1936) Iris Data';

proc aceclus data=sashelp.iris out=ace p=.02 outstat=score;
   var SepalLength SepalWidth PetalLength PetalWidth ;
run;
proc sgplot data=ace;
   scatter y=can2 x=can1 / group=Species;
   keylegend / title="Species";
run;
proc fastclus data=ace maxc=3 maxiter=10 conv=0 out=clus;
   var can:;
run;
proc freq;
   tables cluster*Species;
run;

Output 24.1.1: Using PROC ACECLUS to Transform Fisher’s Iris Data

Fisher (1936) Iris Data

The ACECLUS Procedure
 
Approximate Covariance Estimation for Cluster Analysis

Observations150Proportion0.0200
Variables4Converge0.00100

Means and Standard Deviations
VariableMeanStandard
Deviation
Label
SepalLength58.43338.2807Sepal Length (mm)
SepalWidth30.57334.3587Sepal Width (mm)
PetalLength37.580017.6530Petal Length (mm)
PetalWidth11.99337.6224Petal Width (mm)

COV: Total Sample Covariances
 SepalLengthSepalWidthPetalLengthPetalWidth
SepalLength68.5693512-4.2434004127.431543651.6270694
SepalWidth-4.243400418.9979418-32.9656376-12.1639374
PetalLength127.4315436-32.9656376311.6277852129.5609396
PetalWidth51.6270694-12.1639374129.560939658.1006264


Initial Within-Cluster Covariance Estimate = Full Covariance Matrix

Threshold =0.334211

Iteration History
IterationRMS
Distance
Distance
Cutoff
Pairs
Within
Cutoff
Convergence
Measure
12.8280.945408.00.465775
211.9053.979559.00.013487
313.1524.396940.00.029499
413.4394.4911506.00.046846
513.2714.4352036.00.046859
612.5914.2082285.00.025027
712.1994.0772366.00.009559
812.1214.0512402.00.003895
912.0644.0322417.00.002051
1012.0474.0262429.00.000971

Algorithm converged.


Output 24.1.2: Eigenvalues, Raw Canonical Coefficients, and Standardized Canonical Coefficients

ACE: Approximate Covariance Estimate Within Clusters
 SepalLengthSepalWidthPetalLengthPetalWidth
SepalLength11.733429395.475504324.953890492.02902429
SepalWidth5.475504326.919925902.421778511.74125154
PetalLength4.953890492.421778516.537463982.35302594
PetalWidth2.029024291.741251542.353025942.05166735

Eigenvalues of Inv(ACE)*(COV-ACE)
 EigenvalueDifferenceProportionCumulative
163.771661.15930.93670.9367
22.61231.55610.03840.9751
31.05620.41670.01550.9906
40.6395 0.009391.0000

Eigenvectors (Raw Canonical Coefficients)
 Can1Can2Can3Can4
SepalLengthSepal Length (mm)-.012009-.098074-.0598520.402352
SepalWidthSepal Width (mm)-.211068-.0000720.402391-.225993
PetalLengthPetal Length (mm)0.324705-.3285830.110383-.321069
PetalWidthPetal Width (mm)0.2662390.870434-.0852150.320286

Standardized Canonical Coefficients
 Can1Can2Can3Can4
SepalLengthSepal Length (mm)-0.09944-0.81211-0.495623.33174
SepalWidthSepal Width (mm)-0.91998-0.000311.75389-0.98503
PetalLengthPetal Length (mm)5.73200-5.800471.94859-5.66782
PetalWidthPetal Width (mm)2.029376.63478-0.649542.44134


Output 24.1.3: Plot of Transformed Iris Data: PROC SGPLOT

 Plot of Transformed Iris Data: PROC SGPLOT


Output 24.1.4: Clustering of Transformed Iris Data: Partial Output from PROC FASTCLUS

Fisher (1936) Iris Data

The FASTCLUS Procedure
Replace=FULL Radius=0 Maxclusters=3 Maxiter=10 Converge=0

Cluster Summary
ClusterFrequencyRMS Std DeviationMaximum Distance
from Seed
to Observation
Radius
Exceeded
Nearest ClusterDistance Between
Cluster Centroids
1501.41385.3152 25.8580
2501.88806.8298 15.8580
3501.10165.2768 113.2845

Statistics for Variables
VariableTotal STDWithin STDR-SquareRSQ/(1-RSQ)
Can18.048081.485370.96639428.756658
Can21.900611.856460.0587250.062389
Can31.433951.325180.1574170.186826
Can41.280441.275500.0210250.021477
OVER-ALL4.244991.502980.8763247.085666

Pseudo F Statistic =520.80

Approximate Expected Over-All R-Squared =0.80391

Cubic Clustering Criterion =5.179


WARNING: The two values above are invalid for correlated variables.

Cluster Means
ClusterCan1Can2Can3Can4
12.54528754-0.59273569-0.78905317-0.26079612
28.129882110.525666630.518364990.14915404
3-10.675169640.067069060.270688190.11164209

Cluster Standard Deviations
ClusterCan1Can2Can3Can4
11.5723665841.3935658641.3034118511.372050319
21.7991595522.7438695561.2703441421.370523175
30.9537610250.9319435711.3984560611.058217627


Output 24.1.5: Crosstabulation of Cluster by Species for Fisher’s Iris Data: PROC FREQ

Fisher (1936) Iris Data

The FREQ Procedure

Frequency
Percent
Row Pct
Col Pct
Table of CLUSTER by Species
CLUSTER(Cluster)Species(Iris Species)
SetosaVersicolorVirginicaTotal
1
0
0.00
0.00
0.00
48
32.00
96.00
96.00
2
1.33
4.00
4.00
50
33.33
 
 
2
0
0.00
0.00
0.00
2
1.33
4.00
4.00
48
32.00
96.00
96.00
50
33.33
 
 
3
50
33.33
100.00
100.00
0
0.00
0.00
0.00
0
0.00
0.00
0.00
50
33.33
 
 
Total
50
33.33
50
33.33
50
33.33
150
100.00