help calinski

Title

calinski -- Calinski-Harabasz cluster stopping index from distance matrix

Syntax

calinski , DISTmat(string) IDvar(varname) [NGroups(integer 15) NAME(clname) GRaph *]

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

Optional
ngroups The number of cluster solutions to test (default 15)

name Name of cluster analysis to use

graph plot the index against cluster size

twoway_options options allowed with graph twoway

Description

calinski calculates the Calinski-Harabasz pseudo-F for
stopping rules in cluster analysis, from the pairwise distance matrix.
This is widely used to determine the optimum number of clusters. Stata's
default cluster stop does the same calculation on the basis of the
original variables, but cannot operate on the distance matrix.
calinski is thus useful when the original variables are not
available, or when the distances are created other than as squared
Euclidean distances between variables (as is the case for instance with
sequence analysis).

NB: Stata's built-in clustermat stop, variables(...)
does not estimate the CH pseudo-F on the distance matrix used by
clustermat. Rather, it creates a new temporary distance matrix
based on the variables listed in the variables() option.

calinski depends on discrepancy which
can be installed from SSC:

. ssc install discrepancy

Returns:

r(calinski_#) Calinski-Harabasz pseudo-F for # groups

Remarks

While cluster stop and clustermat stop estimate the
CH pseudo-F by cumulating the sum of squares from ANOVAs of the original
variables on the cluster solution, and are therefore explicitly rooted in
a squared-Euclidean distance point of view, calisnki takes the
distances as they are found. If they are squared distances based on the
original variables, the results will be identical to cluster stop.
If they are squared Euclidean distances from another source, the
interpretation will be the same. If they are other sorts of differences
(e.g., non-Euclidean) the interpretation is not necessarily the same,
but can be understood to be analogous, in the same way as the
discrepancy partitioning of the distance matrix (described by
Studer et al 2011) is analogous to ANOVA.

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.

References

Milligan, G. W., and M. C. Cooper. 1985. An examination of procedures for determining the number of clusters in a dataset. Psychometrika 50: 159-179.

M Studer, G Ritschard, A Gabadinho and NS Müller, Discrepancy analysis of state sequences, Sociological Methods and Research, 40(3):471-510

Author

Brendan Halpin, brendan.halpin@ul.ie

Examples

. calinski, dist(distances) id(id) graph

See Also

cluster stop

dudahart

discrepancy

SADI