Hi
I am doing K-Means clustering in SAS Guide. I have 8950 observations and 21 variables. I chose 6 clusters, but unable to get proper cluster plot. Below my code. Please advise
proc fastclus data=cluster maxclusters=6 out = clust;
var BALANCE--PAYMENT_MINPAY;
run;
proc sort;
by cluster distance;
run;
proc print;
by Cluster;
run;
proc freq data=work.clust; tables cust_id*cluster / nocol nopercent; run;
proc candisc out = can;
class cluster;
var BALANCE --PAYMENT_MINPAY;
run;
proc sgplot data = can;
title "Cluster Analysis for Bank datasets";
scatter y = can2 x = can1 / group = cluster; run;
I chose K = 6 randomly. Anyone can suggest how to choose K in K Means clustering at SAS. I check the elbow method for selecting clusters in Python. No idea how to do it SAS? I am getting good cluster graph for the same dataset in Python.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.