Programming the statistical procedures from SAS

Initial seed from Proc cluster that need to be fed into Proc fastclus

Reply
Contributor
Posts: 27

Initial seed from Proc cluster that need to be fed into Proc fastclus

For large dataset, how PROC CLUSTER is use to get initial seeds that got feed into PROC FASTCLUS. Someone please help me to understand the concept with sample code and dataset (or may be other way around, first getting the cluster seeds from PROC FASTCLUS and feed into PROC CLUSTER).

Community Manager
Posts: 538

Re: Initial seed from Proc cluster that need to be fed into Proc fastclus

I've moved your inquiry into the Statistical Procedures Community where it will get more visibility with experts who can help. Thank you for visiting SAS Online Communities!

Respected Advisor
Posts: 4,606

Re: Initial seed from Proc cluster that need to be fed into Proc fastclus

PROC FASTCLUS can feed small clusters to be grouped by PROC CLUSTER in the following way (adapted from an example in SAS doc) :

/* find a set of 12 clusters with fast method */

proc fastclus data=sashelp.heart(where=(sex="Male")) maxclusters=12

    out=heartClust outseed=heartMeans cluster=fastClusterId;

var height weight Diastolic Systolic MRW Cholesterol;

run;

/* Group the small clusters into larger clusters */

proc cluster data=heartMeans method=average out=heartClusters;

var height weight Diastolic Systolic MRW Cholesterol;

copy fastClusterId;

run;

/* Keep the cluster grouping with three groups */

proc tree noprint ncl=3 data=heartClusters out=heartWardClust;

copy height weight Diastolic Systolic MRW Cholesterol fastClusterId;

run;

/* Assemble the datasets */

proc sort data=heartWardClust;

by fastClusterId;

run;

proc sort data=heartClust;

by fastClusterId;

run;

data clus;

merge heartWardClust heartClust;

by fastClusterId;

run;

/* Plot the clusters against two of the variables */

ods listing style=htmlblue;

proc sgplot data=clus;

scatter x=weight y=Cholesterol /

    group=CLUSTER transparency=0.2 markerattrs=(symbol=circlefilled);

run;

PG

PG
Contributor
Posts: 27

Re: Initial seed from Proc cluster that need to be fed into Proc fastclus

Thanks PG!, I really appreciate this.

Ask a Question
Discussion stats
  • 3 replies
  • 269 views
  • 0 likes
  • 3 in conversation