Programming the statistical procedures from SAS

problem with sas code

Accepted Solution Solved
Reply
Contributor
Posts: 38
Accepted Solution

problem with sas code

Hi all,

 

I have analysed the correlation between two variables: hp and cyl and  i'm writing a code for cluster analysis for the same varibles but ending up with error, need help. The code is:


proc corr data=rank_mtcars out=cluster_mtcars; /*Here rank_mtcars is a predefined dataset*/
var hp cyl;run;
proc cluster data= cluster_mtcars method=centroid rmsstd
outtree=cluster_mtcars;
var cyl hp;run;

 

ERROR: TYPE=ACE, CORR, COV, EST, FACTOR, SSCP, UCORR, or UCOV data sets must be converted to TYPE=DISTANCE. Note that CLUSTER
ignores the _NAME_ and _TYPE_ variables, if any.

Accepted Solutions
Solution
‎07-10-2017 08:53 AM
Trusted Advisor
Posts: 1,621

Re: problem with sas code


All Replies
Trusted Advisor
Posts: 1,621

Re: problem with sas code

Don't you want to do the clustering on the original data set rank_mtcars? It doesn't make sense to me to cluster the correlation matrix.

Contributor
Posts: 38

Re: problem with sas code

Thanks Sir.

 

One  more question: After clustering i got the output as dendogram. 

How to obtain the optimum number of clusters from the dendogram?

Solution
‎07-10-2017 08:53 AM
Trusted Advisor
Posts: 1,621

Re: problem with sas code

Contributor
Posts: 38

Re: problem with sas code

Thanks Sir..!!

Super User
Posts: 9,682

Re: problem with sas code

BTW, Maybe you need 1-rho to make CORR matrix looks like Distance matrix .

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 187 views
  • 0 likes
  • 3 in conversation