Example 1 for PROC FASTCLUS
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: FASTEX1 */
/* TITLE: Example 1 for PROC FASTCLUS */
/* PRODUCT: STAT */
/* SYSTEM: ALL */
/* KEYS: cluster analysis, Fisher's Iris Data */
/* PROCS: FASTCLUS, FREQ, CANDISC, SGPLOT */
/* DATA: */
/* */
/* SUPPORT: sasrbk */
/* REF: PROC FASTCLUS, EXAMPLE 1. */
/* MISC: */
/****************************************************************/
title 'Fisher (1936) Iris Data';
proc fastclus data=sashelp.iris maxc=2 maxiter=10 out=clus;
var SepalLength SepalWidth PetalLength PetalWidth;
run;
proc freq;
tables cluster*species;
run;
proc fastclus data=sashelp.iris maxc=3 maxiter=10 out=clus;
var SepalLength SepalWidth PetalLength PetalWidth;
run;
proc freq;
tables cluster*Species;
run;
proc candisc anova out=can;
class cluster;
var SepalLength SepalWidth PetalLength PetalWidth;
title2 'Canonical Discriminant Analysis of Iris Clusters';
run;
proc sgplot data=Can;
scatter y=Can2 x=Can1 / group=Cluster;
title2 'Plot of Canonical Variables Identified by Cluster';
run;