BookmarkSubscribeRSS Feed
saslove
Quartz | Level 8

Hi. I am doing a Cluster analysis. I ended up doing Hierarchial Clustering by

Wards method for my binary(dichotomous) variables dataset.

I would like to know how I can get a scatter plot showing the three clusters

neatly in different symbols and colors. I am struggling with this. Can you

please help me.

Thanks

PNS

3 REPLIES 3
ieva
Pyrite | Level 9

Could this help you?

SYMBOL1 V=circle C=black;

SYMBOL2 V=star   C=red;

SYMBOL3 V=diamond C=blue;

   proc gplot data=test;

      plot var2*var1=Cluster;

   run;

More info about symbol statement on:

http://www.psych.yorku.ca/lab/sas/sgsumry5.htm

saslove
Quartz | Level 8

Hello

I tried doing this, but I need a cluster plot with all the 33 variables shown across the plot on three different clusters. I have no idea how I should be plotting this. ? Could someone help?

Thanks

PGStats
Opal | Level 21

With binary data, assuming no missing values, all you can show is the number of observations having each variable's state in every cluster, i.e. the strength or importance of each variable in the clusters. You could do this with three horizontal bar graphs side by side. Something along the lines of:

/* Assuming dataset myData contains variables
id: unique observation id,
clusId: cluster to which the observation belongs,
v1 to v33: dichotomous variables with values 0 or 1 */

proc sort data=myData; by clusId id; run;

proc transpose data=myData out=myTData name=myVariable;
var v1--v33;
by clusId id;
run;

ods graphics on;
proc sgpanel data=myTData;
panelby clusId / layout=columnlattice;
hbar myVariable / response=col1 stat=sum;
run;

Good luck.

PG

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1086 views
  • 0 likes
  • 3 in conversation