help sqtab(SJ6-4: st0111)

Title

sqtab -- Tabulate sequences

Syntax

sqtab
[varname]
[if] [in]
[, options]

ranks(numlist) restrict tabulation on most frequent numlist

se apply same-elements similarity

so apply same-order similarity

nosort do not sort according to frequency

gapinclude include sequences with gaps in the tabulation

subsequence(a,b) use only subsequence between positions a and b

tabulate_options any options documented in tabulate

Description

sqtab displays frequency tables of all sequences in the
dataset. Sequences are described by using the following notation:
element[:repetitions] [element:repetitions]. 3:20 5 1:20 3:20
describes a sequence that starts with element 3 over 20 positions, followed
by one position of elment 5, 20 positions of element 1 and finally
again 20 positions of element 3.

If the optional variable name is specified, a cross tabulation of
the sequences with the specified variable will be produced.

Options

ranks(numlist) is used to restrict the output to the
most frequent sequences. numlist refers to the position of the
sequences in the sorted frequency table. Hence, ranks(1) refers to the
most frequent sequence only, whereas ranks(1/10) refers to the 10 most
frequent sequences. You can also specify ranks(2(2)20).

se is used to request a frequency table, where similar
sequences have been grouped together beforehand. The concept for
similarity used with the option so is called same elements
similarity, because it treats sequences that consist of the same
elements as identical. Hence, with this option the sequence B-A-A-B
would be treated as identical to A-B-B-A, because both sequences
consist of the elements A and B.

so is used to request a frequency table, where similar
sequences have been grouped together beforehand. The concept for
similarity used with the option so is called same order
similarity, because it treats sequences where the elements appear in
the same order. The sequence A-B-B-A would be treated identical to
A-B-A-A, because the elements A and B appear in the same order in both
sequences (first A, then B, and then A again).

nosort changes the default of listing sequences in the
table according to their frequency. This change is reasonable, because
many sequences are probably unique. The option nosort
turns this default behavior off.

gapinclude is used to include sequences with gaps in the
tabulation. The default behavior is to drop sequences with gaps from
the tabulation, because they cannot be used in the program
sqom. The term gap refers only to missing values on the
element variable within a sequence. Sequences with missing values at
the beginning and at the end of a sequence are included in any
case. See sq for details.

subsequence(a,b) is used to include only the part of
the sequence that is between position a and b, whereby a and b refer
to the position defined in the order variable.

tabulate_options are any of the options documented
in tabulate oneway or tabulate twoway.

Author

Ulrich Kohler, University of Potsdam, ulrich.kohler@uni-potsdam.de

Examples

. sqtab

. sqtab, so ranks(1/20)

. sqtab, se nosort

Also see

Manual: [D] tabulate

Online: sq, sqdemo, sqset,
sqdes, sqegen, sqstat, sqindexplot,
sqparcoord, sqom, sqclusterdat,
sqclustermat