help permtab

Title

permtab -- Rearrange columns of a table to maximise kappa

Syntax

permtab rowvar colvar [if] [in] [, gen(newvarname) algorithm(string) random tables maxiter(real)]

options

algorithm(string) (Optional) select algorithm (exhaustive, hill-climb or genetic algorithm)

random (Optional) If hillclimb algorithm is selected, start from a random permutation

tables (Optional) Show tabulations

maxiter (Optional) Maximum GA iterations (default 250)

Description

permtab permutes the columns of the crosstabulation of
rowvar by colvar to maximise kappa. If the table is not square, it is
padded with rows or columns of zeros. permtab is intended for use
for problems such as comparing cluster solutions where the identity of
categories from one solution to the other is only defined in terms of
membership. Kappa measures the excess of observed over expected on the
diagonal. Kappa_max is the Kappa of the best solution, and is
reported.

A permuted version of colvar is created by the gen option.

Three algorithms are used. By default all permutations are
examined. This is slow for more than 8 categories, and become impossible
above about 11. Second, a hill-climb algorithm takes either the current
ordering or a random permutation of it and looks for all pairwise swaps
that improve fit. Third, a genetic algorithm efficiently searches for an
approximate maximum in the permutation space. Both the hill-climb and
genetic algorithm approaches do very well at finding a good solution.

The algorithm() option controls which is used. The default
(or algorithm(full)) yields all permutations. Hill-climb is
selected by algorithm(hc), and algorithm(hc) random
randomises the starting permutation. The genetic algorithm is selected
by algorithm(ga).

Returns kappa_max as r(kappa).

Returns the best permutation as r(perm).

References

C. Reilly, C. Wang and M. Rutherford, 2005:
A Rapid Method for the Comparison of Cluster Analyses,
Statistica Sinica,
15(1), pp 19-33.

Author

Brendan Halpin, brendan.halpin@ul.ie

Examples

. permtab a8 b8, tables

. permtab a8 b8, gen(b8x)

. permtab a9 b9, algo(hc)

. permtab a9 b9, algo(hc) random

. permtab a32 b32, algo(ga)