BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
atulsingh
Obsidian | Level 7

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.
1 ACCEPTED SOLUTION

Accepted Solutions
6 REPLIES 6
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
atulsingh
Obsidian | Level 7

Thanks Sir.

 

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

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

PaigeMiller
Diamond | Level 26

PROC CLUSTER documentation explains the common ways to do this:

http://documentation.sas.com/?cdcId=statcdc&cdcVersion=14.2&docsetId=statug&docsetTarget=statug_clus...

--
Paige Miller
atulsingh
Obsidian | Level 7

Thanks Sir..!!

Ksharp
Super User

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

vijaylaxmi
Fluorite | Level 6

Hi,

 

Can you please provide me dataset rank_mtcars. I am not able to find it anywhere.

 

Thanks!!

Vijay

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1854 views
  • 0 likes
  • 4 in conversation