【SAS系列】SAS简单实例代码——聚类

来源:互联网 发布:逆战代刷淘宝 编辑:程序博客网 时间:2024/05/21 09:30
data a1;input city $ x1 x2 x3 x4@@;cards;北京  4012.8  1365.8  611.9   813.2天津  2188.8  2631.5  97.1    228.0河北  1047.5  1655.7  66.8    253.3山西  822.6   960.9   94.6    167.5内蒙古 462.9   2476.4  57.9    365.1辽宁  1263.4  3396.2  48.7    382.7吉林  396.9   3503.8  74.0    540.1黑龙江 431.3   3527.7  104.7   446.1上海  5761.4  502.6   579.6   1339.9;run;proc cluster data=a1 standard method=average ccc pseudo out=tree;proc tree data=tree horizontal spaces=1 ;run ; data a2;    set a1;run; proc fastclus data=a2 out=aa maxc=4 cluster=c   list  distance;var x1 x2 x3 x4;id city;run; proc plot data=aa;plot x2*x1=c;run;quit;

0 0