BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
wutao9999
Obsidian | Level 7

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.

1 ACCEPTED SOLUTION

Accepted Solutions
mohamed_zaki
Barite | Level 11

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

View solution in original post

1 REPLY 1
mohamed_zaki
Barite | Level 11

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

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1852 views
  • 0 likes
  • 2 in conversation