# K-medoids clustering with Gower distance in R

I have both numeric and binary data in my data set with 73 observations. I read a lot about which distance metric and which clustering technique to use especially from this web site. I decided to use Gower distance metrics and K-medoids. In R, I used package "cluster", and function "daisy" with metric="gower". So I got a 73*73 matrix. Now, as I understood, this is not a distance matrix, it is a similarity matrix that I am confused what to do after now. I use function pam: pam(x, k, diss = inherits(x, "dist")... Should I use the 73*73 matrix which I got from daisy function?

See the documentation of the pam function, which implements K-medoids.

In case of a dissimilarity matrix, x is typically the output of daisy or dist.

and the documentation of daisy:

“Gower's distance” is chosen by metric "gower" or automatically if some columns of x are not numeric. Also known as Gower's coefficient (1971), expressed as a dissimilarity, this implies that a particular standardisation will be applied to each variable, and the “distance” between two units is the sum of all the variable-specific distances, see the details section.

The documentation of R is pretty good... use it.

• Thank you, I thought that, the matrix I got from daisy with Gower, is not a dissimilarity matrix so I need to use other function to have distance matrix before applying pam. Then, I'm confused sorry, what about diss in pam function? It is TRUE in my case I think. And I couldn't understand also metric=euclidean in pam function, because I used Gower distance... – Emrah Bilgiç Oct 27 '14 at 15:00
• Yes you are right Anony-Mousse, thank you so much. I am reading, studying, trying to understand everything, sometimes confused. – Emrah Bilgiç Oct 28 '14 at 0:38
• The examples here (stat.berkeley.edu/~s133/Cluster2a.html) are also good answer for my question – Emrah Bilgiç Oct 28 '14 at 1:28