For the SAS cluster procedure, how to define the number of clusters as cluster output? For example, if I want to have 3 clusters after clustering:
cluster method = eml data = dateset outtree = output ;
by column1 ;
var net_sales ;
run ;
What changes I need to make to enforce the above cluster procedure only generating 3 clusters? Thank you.
PROC CLUSTER requires more work to do. Why do not you use PROC FASTCLUSTER and use the maxc= option in it. Also you can added it to a macro to try different number of cluster.
But if you still need to use PROC CLUSTER you can use PROC TREE after it and use nclusters= option to choose the number of cluster. Here is a good example of using PROC CLUSTER and PROC TREE. Example 91.1 Mammals’ Teeth
PROC CLUSTER requires more work to do. Why do not you use PROC FASTCLUSTER and use the maxc= option in it. Also you can added it to a macro to try different number of cluster.
But if you still need to use PROC CLUSTER you can use PROC TREE after it and use nclusters= option to choose the number of cluster. Here is a good example of using PROC CLUSTER and PROC TREE. Example 91.1 Mammals’ Teeth
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.