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 38: 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
COV: Total Sample Covariances | ||||
---|---|---|---|---|
SepalLength | SepalWidth | PetalLength | PetalWidth | |
SepalLength | 68.5693512 | -4.2434004 | 127.4315436 | 51.6270694 |
SepalWidth | -4.2434004 | 18.9979418 | -32.9656376 | -12.1639374 |
PetalLength | 127.4315436 | -32.9656376 | 311.6277852 | 129.5609396 |
PetalWidth | 51.6270694 | -12.1639374 | 129.5609396 | 58.1006264 |
Iteration History | ||||
---|---|---|---|---|
Iteration | RMS Distance |
Distance Cutoff |
Pairs Within Cutoff |
Convergence Measure |
1 | 2.828 | 0.945 | 408.0 | 0.465775 |
2 | 11.905 | 3.979 | 559.0 | 0.013487 |
3 | 13.152 | 4.396 | 940.0 | 0.029499 |
4 | 13.439 | 4.491 | 1506.0 | 0.046846 |
5 | 13.271 | 4.435 | 2036.0 | 0.046859 |
6 | 12.591 | 4.208 | 2285.0 | 0.025027 |
7 | 12.199 | 4.077 | 2366.0 | 0.009559 |
8 | 12.121 | 4.051 | 2402.0 | 0.003895 |
9 | 12.064 | 4.032 | 2417.0 | 0.002051 |
10 | 12.047 | 4.026 | 2429.0 | 0.000971 |
Output 24.1.2: Eigenvalues, Raw Canonical Coefficients, and Standardized Canonical Coefficients
ACE: Approximate Covariance Estimate Within Clusters | ||||
---|---|---|---|---|
SepalLength | SepalWidth | PetalLength | PetalWidth | |
SepalLength | 11.73342939 | 5.47550432 | 4.95389049 | 2.02902429 |
SepalWidth | 5.47550432 | 6.91992590 | 2.42177851 | 1.74125154 |
PetalLength | 4.95389049 | 2.42177851 | 6.53746398 | 2.35302594 |
PetalWidth | 2.02902429 | 1.74125154 | 2.35302594 | 2.05166735 |
Eigenvectors (Raw Canonical Coefficients) | |||||
---|---|---|---|---|---|
Can1 | Can2 | Can3 | Can4 | ||
SepalLength | Sepal Length (mm) | -.012009 | -.098074 | -.059852 | 0.402352 |
SepalWidth | Sepal Width (mm) | -.211068 | -.000072 | 0.402391 | -.225993 |
PetalLength | Petal Length (mm) | 0.324705 | -.328583 | 0.110383 | -.321069 |
PetalWidth | Petal Width (mm) | 0.266239 | 0.870434 | -.085215 | 0.320286 |
Standardized Canonical Coefficients | |||||
---|---|---|---|---|---|
Can1 | Can2 | Can3 | Can4 | ||
SepalLength | Sepal Length (mm) | -0.09944 | -0.81211 | -0.49562 | 3.33174 |
SepalWidth | Sepal Width (mm) | -0.91998 | -0.00031 | 1.75389 | -0.98503 |
PetalLength | Petal Length (mm) | 5.73200 | -5.80047 | 1.94859 | -5.66782 |
PetalWidth | Petal Width (mm) | 2.02937 | 6.63478 | -0.64954 | 2.44134 |
Output 24.1.4: Clustering of Transformed Iris Data: Partial Output from PROC FASTCLUS
Fisher (1936) Iris Data |
Cluster Summary | ||||||
---|---|---|---|---|---|---|
Cluster | Frequency | RMS Std Deviation | Maximum Distance from Seed to Observation |
Radius Exceeded |
Nearest Cluster | Distance Between Cluster Centroids |
1 | 50 | 1.4138 | 5.3152 | 2 | 5.8580 | |
2 | 50 | 1.8880 | 6.8298 | 1 | 5.8580 | |
3 | 50 | 1.1016 | 5.2768 | 1 | 13.2845 |
Output 24.1.5: Crosstabulation of Cluster by Species for Fisher’s Iris Data: PROC FREQ
Fisher (1936) Iris Data |
|
|