The TREE Procedure

Example 120.2 Iris Data

(View the complete code for this example.)

Fisher (1936)’s iris data give sepal and petal dimensions for three different species of iris. The data, which are available in the Sashelp library, are clustered by kth-nearest-neighbor density linkage by using the CLUSTER procedure with K=8. Observations are identified by species ('Setosa', 'Versicolor', or 'Virginica') in the tree diagram, which is oriented with the height axis horizontal.

The following statements produce the results shown in Output 120.2.1:

title 'Fisher (1936) Iris Data';
ods graphics on;

proc cluster data=sashelp.iris method=twostage print=10
             outtree=tree k=8 noeigen;
   var SepalLength SepalWidth PetalLength PetalWidth;
   copy Species;
run;
proc tree data=tree horizontal lineprinter pages=1 maxh=10;
   id species;
run;

The PAGES=1 option specifies that the tree diagram extend over one page from tree to root. Since the HORIZONTAL option is also specified, the horizontal extent of the diagram is one page. The number of vertical pages required for the diagram is dictated by the number of leaves in the tree.

The MAXH=10 limits the values displayed on the height axis to a maximum of 10. This prunes the tree diagram so that only the portion from the leaves to level 10 is produced. The line printer plot is not displayed.

Output 120.2.1: Clustering of Fisher’s Iris Data

Fisher (1936) Iris Data

The CLUSTER Procedure
Two-Stage Density Linkage Clustering


K = 8

Root-Mean-Square Total-Sample Standard Deviation10.69224

Cluster History
Number
of
Clusters
 FreqNormalized
Fusion Density
Maximum Density
in Each Cluster
Tie
Clusters JoinedLesserGreater
10CL11OB79480.28790.14798.3678 
9CL13OB112460.28020.20053.5156 
8CL10OB113490.26990.13728.3678 
7CL8OB91500.25860.13728.3678 
6CL9OB120470.14120.08323.5156 
5CL6OB118480.1070.06053.5156 
4CL5OB110490.09690.05413.5156 
3CL4OB135500.07150.03703.5156 
2CL7CL31002.62773.51568.3678 


3 modal clusters have been formed.