seqST | R Documentation |
Elzinga's turbulence for each sequence in a sequence data set.
seqST(seqdata, norm=FALSE, silent=TRUE, with.missing=FALSE, type=1)
seqdata |
a state sequence object as returned by the the |
norm |
logical: should the turbulence index be normalized? |
silent |
logical: should messages about running operations (extracting dss and durations, computing turbulence) be displayed? |
with.missing |
logical: should non-void missing values be treated as a regular state? If |
type |
either 1 or 2. Type of duration variance. The default |
Sequence turbulence is a measure proposed by Elzinga
& Liefbroer (2007). It is based on the number \phi(x)
of distinct subsequences that can be extracted from the distinct
successive state (DSS) sequence and the variance of the consecutive times t_i
spent in the distinct states. For a sequence x
, the formula is
T(x)=\log_{2}(\phi(x)\,\frac{s_{t,max}^2(x) + 1}{s_t^2(x) + 1})
where s_t^2(x)
is the variance of the successive state
durations in sequence x
and s_{t,max}^2(x)
is the maximum
value that this variance can take given the number of spells and the total
duration of the sequence. For type=1
, this maximum is computed as
s_{t,max}^2 =(d-1)(1-\bar{t})^2
where \bar{t}
is the mean consecutive time spent in the
distinct states, i.e. the sequence duration t
divided by the number
d
of distinct states in the sequence.
For type=2
, the variance takes into account the 0-time spent in non-visited states and the maximum is adjusted for the maximum number of non-visited states for the number of spells (see Ritschard, 2021).
When with.missing=TRUE
, the function searches for missing states in the sequences and if found, adds the missing state to the alphabet for the computation of the turbulence. In this case the seqdss
and seqdur
functions for extracting the distinct successive state sequences and the associated durations are called with the {with.missing=TRUE}
argument. Thus, a missing state in a sequence is considered as the occurrence of an additional symbol of the alphabet and two or more consecutive missing states are considered as two or more occurrences of this additional state. E.g. the DSS of A-A-*-*-*-B-B-C-C-D
is A-*-B-C-D
and the associated durations are 2-3-2-2-1
.
The normalized value is obtained by subtracting 1 to the index and then dividing by the resulting value for a sequence made by the successive repetition of the alphabet up to the maximal length in seqdata
(Ritschard, 2021)).
a sinlge-column matrix of length equal to the number of sequences in
seqdata
containing the turbulence value of each sequence. Normalized values are returned when norm=TRUE
.
Alexis Gabadinho and Gilbert Ritschard
Elzinga, Cees H. and Liefbroer, Aart C. (2007). De-standardization of Family-Life Trajectories of Young Adults: A Cross-National Comparison Using Sequence Analysis. European Journal of Population, 23, 225-250.
Ritschard, G. (2023), "Measuring the nature of individual sequences", Sociological Methods and Research, 52(4), 2016-2049. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/00491241211036156")}.
seqdss
, seqdur
, seqsubsn
. For alternative measures of sequence complexity see seqivolatility
, seqici
, seqindic
.
## Loading the 'actcal' example data set
data(actcal)
## Here we consider only the first 10 sequences
actcal <- actcal[1:10,]
## Defining a sequence object with data in columns 13 to 24
## (activity status from January to December 2000)
actcal.seq <- seqdef(actcal[,13:24], informat='STS')
## Computing the sequences turbulence
turb <- seqST(actcal.seq)
## Normalized turbulence
turb.norm <- seqST(actcal.seq, norm=TRUE)
## Normalized turbulence taking non-visited states into account.
turb2.norm <- seqST(actcal.seq, norm=TRUE, type=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.