Help using Base SAS procedures

How to define the number of clusters for the cluster procedure.

Accepted Solution Solved
Reply
Contributor
Posts: 52
Accepted Solution

How to define the number of clusters for the cluster procedure.

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.


Accepted Solutions
Solution
‎03-11-2015 08:14 AM
Super Contributor
Posts: 490

Re: How to define the number of clusters for the cluster procedure.

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


All Replies
Solution
‎03-11-2015 08:14 AM
Super Contributor
Posts: 490

Re: How to define the number of clusters for the cluster procedure.

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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