BookmarkSubscribeRSS Feed
Eileen18
Calcite | Level 5

Hi, first off, I am new to cluster analysis and am still learning the appropriate methods to emply.  I am trying to divide a variable ("condition") with 300 levels  into clusters based on 1 numberical/continuous variable ("active_score"). Using proc cluster to start (code below) I am seeing that the y-axis of the dendrogram is unreadable as the labels are all on top of eachother (dendrogram image attached).  I was trying to find a way to space out the labels but unsuccessfully.. any ideas? It also might just be that proc cluster is not the best way to go (proc fastclus or proc varclus?) Again, I'm learning so might need to move to another procedure but still wondering if I can make it work to be able to adjust the y-axis to see what I have. I'm using SAS 9.4.  Thank you in advance!!

 

Proc cluster simple method=centroid rmsstd rsquare nonorm out=tree plots(maxpoints=1000);

id condition; 

var active_score; 

run; 

proc tree out=cluster nclusters=5 inc=10 ; 

id condition; 

copy active_score; 

 

proc sort; by cluster;

 

proc print; by cluster; 

var  condition active_score; 

run; 

 

 

 

 

 

 

 

 

5 REPLIES 5
Eileen18
Calcite | Level 5

thank you so much for your reply! I tried the below but it isn't working; nothing changed in the display.

 Here is what I tried: I reviewed the computeheight option and tried increasing by a factor of 3 to start(?) and  changed the unit to inches.  Seems I'm missapplying the suboptions, but not sure what is wrong. I tried searching for an example that applied these suboptions and couldn't find one. Any suggestions for me? Thank you again very much! 

 

Proc cluster simple method=centroid rmsstd rsquare nonorm out=tree plots(maxpoints=1000)

plots=dendrogram(unit=in computeheight=3.12 .375)   ;

id condition; 

var active_score; 

run; 

WarrenKuhfeld
Rhodochrosite | Level 12
proc cluster data=sashelp.mileages(type=distance) method=density k=3
   plots=dendrogram(ch=3 5 unit=in);
   id City;
run;

I just tried the option and it affects the size for me.

Eileen18
Calcite | Level 5

Ah- great to know it does in fact work.  I tried the plots=dendrogram(ch=3 5 unit=in) option and am seeing the attached (a blank graph; ods graphics are on. I am in SAS enterprise 9.4) so maybe it's something with my data (too many levels to the id var?) I will continue to try some different sub-options and explore different methods as well.  

 

thank you again!

 

 

WarrenKuhfeld
Rhodochrosite | Level 12

I just tried this and it made a really big graph.

data x;
   array x[100];
   do i = 1 to 10 * dim(x);
      do j = 1 to dim(x);
         x[j] = uniform(368);
         end;
       output;
      end;
   run;
           
ods html body='b.html';
ods graphics on;
proc cluster plots(only maxpoints=5000) = dendrogram(unit=in sh=100) method=ward;
   ods select dendrogram;
run;         
ods html close;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1727 views
  • 2 likes
  • 2 in conversation