help getmedoids

Title

getmedoids -- Identify medoids from group variable and distance matrix

Syntax

getmedoids varname, DISTmat(matrix) IDvar(varname) gen(newvarname)

options

Required
distmat(matname) names the distance matrix

idvar(varname) identifies the variable that links the sort-order of the distance matrix to the sort-order of the data

gen(newvarname) Name of new variable in which to store the medoids

Description

getmedoids generates a binary variable indicating the medoids of clusters.

getmedoids operates on a distance matrix and a grouping
variable, and generates a binary variable identifying the medoids, i.e.,
the cases closes to the centre of each group. Where multiple cases are
equally close to the centre, the first is taken.

Remarks

Because the order of the data and the order of the distance matrix
must coincide, the dataset must be sorted by idvar. It is the
user's responsibility that this variable defines the correct order.

In the event that more than one sequence is nearest a cluster
centre, the last observed is marked as the medoid. This is common when
there are duplicate sequences, in which case the value of the medoid is
unaffected, but it is theoretically possible to have two or more
distinct sequences equidistant from the cluster centre.

Author

Brendan Halpin, brendan.halpin@ul.ie

Examples

. getmedoids k4, dist(distances) id(id) gen(k4m)

See Also

getgroup

clpam

clfuzz

calinski

dudahart

discrepancy

SADI