Help using Base SAS procedures

Changing display of y-axis dedrogram (proc cluster, proc tree)

Reply
New Contributor
Posts: 3

Changing display of y-axis dedrogram (proc cluster, proc tree)

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; 

 

 

 

 

 

 

 

 

SAS Super FREQ
Posts: 503

Re: Changing display of y-axis dedrogram (proc cluster, proc tree)

New Contributor
Posts: 3

Re: Changing display of y-axis dedrogram (proc cluster, proc tree)

[ Edited ]
Posted in reply to WarrenKuhfeld

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; 

SAS Super FREQ
Posts: 503

Re: Changing display of y-axis dedrogram (proc cluster, proc tree)

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.

New Contributor
Posts: 3

Re: Changing display of y-axis dedrogram (proc cluster, proc tree)

[ Edited ]
Posted in reply to WarrenKuhfeld

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!

 

 

SAS Super FREQ
Posts: 503

Re: Changing display of y-axis dedrogram (proc cluster, proc tree)

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;
Ask a Question
Discussion stats
  • 5 replies
  • 355 views
  • 2 likes
  • 2 in conversation