# How does the Gower distance calculate the difference between binary variables'?

I have 17 numeric and 5 binary (0-1) variables, with 73 samples in my dataset. I need to run a cluster analysis. I know that the Gower distance is a good metric for datasets with mixed variables. However, I couldn't understand how the Gower distance calculates the difference between binary variables. It seems to me that it is not different from Euclidean distance.

• Your question isn't quite clear. Are you simply asking 'how does the Gower distance calculate the difference between binary variables'? What does "there is no difference than Euclidean" mean? Commented Oct 21, 2014 at 15:42
• Thank you. Sorry, I ask how Gower calculate the difference between binary variables. I mean, I couldn't understand the differences btw. Euclidean and Gower for binary variable. Commented Oct 21, 2014 at 15:58
• Have you searched this site for Gower? stats.stackexchange.com/a/15313/3277 Commented Oct 21, 2014 at 16:48
• Yes I did. Euclidean distance is 0, if both samples have same value, 1 if not. What about Gower? Commented Oct 21, 2014 at 16:57
• @EmrahBilgiç, Gower metric is similarity, not distance. It becomes "distance" when is subtracted from 1. Read under the link above how it processes binary data. Commented Oct 21, 2014 at 17:31

## 2 Answers

How about binary attributes that have the values "m" and "f", for "male" and "female"?

You do realize that for a dicotomous variable all you can get out is "same" or "different"? The key point difference between distances is not if the value is 1 or 0; but how multiple variables are combined.

Gower distance uses Manhattan for calculating distance between continuous datapoints and Dice for calculating distance between categorical datapoints