Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

In my dataset we have both continuous and discrete variables. I want to know whether we can do hierarchical clustering using both type of variables.

share|improve this question
What software are you using? – rolando2 Sep 7 '11 at 16:56
@rolando2: I'm using R (hclus package). – Ari Sep 7 '11 at 17:11
1  
Is there a reason for using hierarchical clustering? – suncoolsu Sep 7 '11 at 19:13
Na. I just asking this question for the sake of my knowledge. Can we do hierarchical when we have mixed data type. If yes, then why? If no, then why? – Ari Sep 7 '11 at 19:55
@user4278 Well, what's your goal in fine? Are you looking to identify clusters (of individuals)? – chl Sep 7 '11 at 20:52
show 1 more comment

1 Answer

up vote 4 down vote accepted

One way is to use Gower similarity coefficient which is a composite measure; it takes quantitative (such as rating scale), binary (such as present/absent) and nominal (such as worker/teacher/clerk) variables.

When all variables are quantitative then the coefficient is a normalized Manhattan distance converted into similarity. When all variables are binary then the coefficient is a famous Jaccard matching coefficient. When all variables are nominal then the coefficient is dice matching coefficient that you obtain from your nominal vars if recode them into dummy vars. Usually a program calculating Gower will allow you to weight variables, that is, their contribution, to the composite formula.

share|improve this answer
Thanks ttnphns! Can you please tell me is "Gower similarity coefficient" is integrated in hclus package in R? Is there any package in R that has this functionality. – Ari Sep 8 '11 at 16:22
I'm not R user so don't know, and don't think you'll find it in hclus. But if you Google "Gower similarity R" you are sure to find what you need! – ttnphns Sep 8 '11 at 16:28
Thanks a lot ttnphns! – Ari Sep 8 '11 at 22:20
user4278, Just in case you don't shun SPSS, I have a macro for Gower similarity on my web-page. It accepts weighting and missing data. – ttnphns Sep 9 '11 at 7:44
@user4278 About R specifically, start here: cran.r-project.org/web/views/Environmetrics.html – chl Sep 9 '11 at 9:57
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.