data dat1 ; input id $ m1 m2 ; cards ; A 1 3 B 3 3 C 4 3 D 5 3 E 1 2 F 4 2 G 1 1 H 2 1 I 3 5 J 4 6 K 3 6 ; proc print ; run ; proc sgplot data=dat1 ; scatter x=m1 y=m2 / datalabel=id ; yaxis values=(0 to 7 by 1) ; xaxis values=(0 to 7 by 1) ; run; proc cluster data=dat1 out=clsdat method=ward print= 7 ccc pseudo ; var m2 m1 ; copy id ; run ; proc tree data=clsdat noprint ncl=5 out=out ; copy m2 m1 id ; run ; proc sgplot data=out; scatter y=m2 x=m1 / group=cluster datalabel=id ; run; /* Canonical discriminant analysis is equivalent to canonical correlation analysis between the quantitative variables and a set of dummy variables coded from the class variable. */ proc candisc data=out noprint out=can; class cluster; var m2: m1:; run; proc sgplot data=can; scatter y=can2 x=can1 / group=cluster datalabel=id ; yaxis values=(-5 to 5 by 1) ; xaxis values=(-5 to 5 by 1) ; run;