help omav

Title

omav -- Calculate inter-sequence distances using duration-compensated Needleman--Wunsch algorithm

Syntax

omav varlist , options [option]

options

Cost structure
subsmat(matname) use matname as the substitution cost matrix

indel(#) use # as the cost for insertions/deletions

Sequence length length(var) sequence
length, a variable or a constant if sequence length is fixed

Distances pwdist(matname) store the
pairwise distances in matname, as a symmetric matrix. Will be
created or overwritten.

Duration adjustment facexp(real)
(Optional) Exponent by which to adjust costs for duration (defaults to 0.5)

Work-space workspace (Optional) Causes the internal
workspace matrices to be shown for each sequence comparison.

Description

omav calculates duration-adjusted Optimal Matching
distances between all pairs of sequences in the data, where
varlist is a consecutive set of variables describing the
elements of the sequence. It uses a Stata plugin implementation of
an adapted Needleman-Wunsch algorithm. It differs from the
standard oma command in that the costs of elementary
operations are reduced for tokens that are elements of runs of the
same value. By default, the cost of an operation on an element of
an n-element sequence is changed by a factor of 1/n^f where f is
given by the fac:exp option. The value of f defaults to 0.5.
A value of f of zero produces the same result as oma and a
value of f of 1.0 weights all spells the same regardless of length.

Note: this measure is not guaranteed to be metric.

States must be numbered as consecutive integers from 1 up, and the
substitution cost matrix must be square, with dimension equal to the
number of states. States must not be missing.

References

Halpin, Brendan. (2010).
Optimal Matching Analysis and Life
Course Data: the importance of duration
Sociological Methods and Research, 38(3)

Halpin, Brendan. (2014). Three narratives of sequence
analysis, Bühlmann et al (eds), Advances in Sequence Analysis.
Beyond the Core Program, Springer

Author

Brendan Halpin, brendan.halpin@ul.ie

Examples

. matrix scost = (0,1,2,3\1,0,1,2\2,1,0,1\3,2,1,0)

. omav mon1-mon36, subsmat(scost) indel(2) pwdist(dist) len(36)

. matrix list dist

. omav mon1-mon72, subsmat(scost) indel(2) pwdist(dist) len(dur) facexp(0.75)

. matrix list dist