Solved – K-medoids clustering with Gower distance in R

clusteringgower-similarityr

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?

Best Answer

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.

Related Question