Login
Order Now
Support
SAS Task on Cluster Analysis

SAS Task on Cluster Analysis

  • 12th Oct, 2021
  • 16:07 PM

libname data "/home/u38225190/Delete/2020";  *Specifying the library;

/*Reading data*/
data data;
    set data.income_byzip_njny_metro;
run;

/*Q1*/
/*K means clustering*/
proc fastclus data = data out = out maxc= 7 list;
var Returns_pct1 - Returns_pct6 ;
id zipcode;
title 'K MEANS CLUSTER ANALYSIS';
RUN;

proc print data=out; run;


/*Q2*/
/*Hierachical clustering*/
ods graphics on;
proc cluster data=data method=ward ccc pseudo  outtree=treedata print=15;
var Returns_pct1 - Returns_pct6 ;
id zipcode;
run; 

proc print data=treedata; run; 

/*Cluster in to 7 clusters*/
proc tree data = treedata out = cluster_data
nclusters = 7 noprint;
id zipcode;
quit;

proc print data=cluster_data; run;

Share this post

assignment helpassignment helperassignment expertsassignment writing services