Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

cluster analysis

Reply
Contributor
Posts: 24

cluster analysis

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

Frequent Contributor
Posts: 82

cluster analysis

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

Contributor
Posts: 24

cluster analysis

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

Respected Advisor
Posts: 4,654

cluster analysis

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
Ask a Question
Discussion stats
  • 3 replies
  • 275 views
  • 0 likes
  • 3 in conversation