BookmarkSubscribeRSS Feed
niyi
Calcite | Level 5

what is the syntax for proc list in proc tree that will list members of each cluster

7 REPLIES 7
Shmuel
Garnet | Level 18

"The TREE procedure creates tree diagrams from a SAS data set containing the tree structure. You can create this type of data set with the CLUSTER or VARCLUS procedure."  (quoted from SAS 9.2 O.L. Doc);

 

As you are looking for a list and not a diagram, I guess that, maybe, proc print may help you.

 

Please display what output you expect.

niyi
Calcite | Level 5
i want to see the list of individual members of each cluster in a tree
Shmuel
Garnet | Level 18

I have very little experience with proc tree and using SAS UE I have no access to SAS Stat.

Anyhow, I guess that sorting your data by cluster and printing it may help:

 

proc sort data=have out=temp; by <cluster variable>; run;

proc print data=temp;

   by <cluster variable>; 

run;

 

 

Reeza
Super User

@Shmuel SAS UE supports SAS/STAT procedures. 

 

@niyi Can you post your current Proc tree code and/or any preceding code. 

niyi
Calcite | Level 5

Thanks samuel see below

proc cluster data=outmean out=outff
outtree=tree method=average pseudo;
  id Acces_Number;
run;
proc fastclus data=outmean
out=outff outstat=outstat MAXCLUSTERS=5;
id Acces_Number;
run;
proc freq data=outff ;
tables cluster*Acces_Number/list
nofreq nopercent norow nocol;
run;
options text=10pct title=5pct;
proc tree data=tree HPAGES=3;
   id Acces_Number;
height _rsq_;
run;
PROC CLUSTER DATA=Wildvig_Oyatomi METHOD=ward pseudo standardize;
VAR TERMLLT--SEEDPPD;
id Acces_Number;
RUN;

PROC TREE;
id Acces_Number;
RUN;

niyi
Calcite | Level 5
proc cluster data=outmean out=outff
outtree=tree method=average pseudo;
id Acces_Number;
run;
proc fastclus data=outmean
out=outff outstat=outstat MAXCLUSTERS=5;
id Acces_Number;
run;
proc freq data=outff ;
tables cluster*Acces_Number/list
nofreq nopercent norow nocol;
run;
options text=10pct title=5pct;
proc tree data=tree HPAGES=3;
id Acces_Number;
height _rsq_;
run;
PROC CLUSTER DATA=Wildvig_Oyatomi METHOD=ward pseudo standardize;
VAR TERMLLT--SEEDPPD;
id Acces_Number;
RUN;

PROC TREE;
id Acces_Number;
RUN;
PGStats
Opal | Level 21

Assuming that you have used OUTTREE=procClusterOuttree with proc cluster, get the cluster membership for, say, 3 clusters with :

 

proc tree data=procClusterOuttree noprint nclusters=3 out=Clusters;
run;

 

proc sort data=Clusters; by CLUSTER; run;

 

proc print data=Clusters; run;

 

 

PG

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1143 views
  • 2 likes
  • 4 in conversation