{smcl}
{* Copyright 2007 Brendan Halpin brendan.halpin@ul.ie
Distribution is permitted under the terms of the GNU General Public Licence
}
{* 16July2007}{...}
{cmd:help combin}
{hline}

{title:Title}

{p2colset 5 17 23 2}{...} {p2col:{hi:combin} {hline 2}}Calculate
inter-sequence similarities using Elzinga's X-T algorithm{p_end}
{p2colreset}{...}

{title:Syntax}

{p 8 17 2}
{cmd:combin} {it: varlist} {cmd:,} {it:options}

{synoptset 22 tabbed}{...}
{synopthdr:options}
{synoptline}

{syntab:Sequence length} {synopt :{opt len:gth(var)}} Number of spells in the sequence{p_end}

{syntab:Distances} {synopt :{opt pws:im(matname)}} store the
pairwise similarities in {it:matname}, as a symmetric matrix. Will be
created or overwritten. {p_end}

{synoptline} {p2colreset}{...}



{title:Description}

{pstd}{cmd:combin} calculates Elzinga's X-T combinatorial
similarity between all pairs of sequences in the data, where
{it:varlist} is a consecutive set of variables describing the
spells of the sequence, with the state variable followed by the
spell duration variable. It uses a Stata plugin implementation of
an algorithm that first enumerates all sub-sequences of all
sequences, and then carries out the pairwise comparison. 

{pstd}

{title:Author}

{pstd}Brendan Halpin, brendan.halpin@ul.ie{p_end}


{title:Examples}

{phang}{cmd:. combin x1 l1 x2 l2 x3 l3 x4 l4, pwsim(sim) len(nspells)}{p_end}
{phang}{cmd:. matrix dist=J(_N,_N,1) - sim}{p_end}
{phang}{cmd:. matrix list dist}{p_end}

