help combinprep

Title

combinprep -- Transform sequences from wide calendar format to wide spell format

Syntax

combinprep, options

options

Options
state(string) Stub of state variable name, in reshape fashion

length(string) Stub of spell-length variable name (will be created)

idvar(varname) ID variable

nspells(varname) number-of-spells variable (will be created)

Note

combinprep continues to work but cal2spell supersedes
it. cal2spell retains both calendar variables and spell variables
in the same dataset whereas combinprep replaces the calendar with
the spell representation.

Description

combinprep takes sequence data in wide calendar format
(i.e., a consecutive string of numbered state variables representing
state in each time unit, with one case per sequence) and turns it into
wide spell format (consecutive pairs of numbered state and duration
variables) with a separate variable indicating the number of spells.

It returns the maximum number of spells observed in r(maxspells)
and the range of the state variable in r(nels).

This can be used to prepare the data for combinadd and
other techniques that focus on spell history rather than state history.

Author

Brendan Halpin, brendan.halpin@ul.ie

Examples

Given sequences represented as consecutive variables s1-s40:

. combinprep, state(s) length(dur) nspells(nsp)

will generate a new structures with variable pairs s1,
dur1 to sX, durX where X is the maximum number of
spells observed. The spells are defined as consecutive runs in the same
state, and their duration is recorded in the dur variable. The
observed number of spells in each case is recorded in nsp.