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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.