seqindic: Sequence indicators

View source: R/seqindic.R

seqindicR Documentation

Sequence indicators

Description

Table of per sequence values of selected indicators.

Usage

seqindic(seqdata, indic=c("visited","trans","entr","cplx","turb2n"),
    with.missing=FALSE, ipos.args=list(), prec.args=list(), w=.5)

Arguments

seqdata

a state sequence object (class stslist) as returned by seqdef.

indic

vector of character strings. List of selected indicators among "lgth" (sequence length), "nonm" (number of non-missing elements), "dlgth" (number of spells), "visited" (number of visited states), "visitp" (proportion of states visites), "trans" (number of state changes), "transp" (number of state changes as a proportion of maximum possible transitions), "meand" (mean spell duration), "dustd" (duration standard deviation), "meand2" (mean spell duration taking non-visited states into account), "dustd2" (duration standard deviation taking non-visited states into account), "entr" (longitudinal normalized entropy), "nsubs" (number of subsequences of the DSS sequence), "volat" (objective volatility), "cplx" (complexity index), "turb" (turbulence), "turbn" (normalized turbulence), "turb2" (turbulence taking non-visited states into account), "turb2n" (normalized turbulence taking non-visited states into account), "ppos" (proportion of positive states), "nvolat" (normative volatility), "vpos" objective volatility of positive-negative state sequences, "integr" (integrative potential), "degrad" (degradation), "bad" (badness), "prec" (precarity index), "insec" (insecurity). Can also be "all", "basic", "diversity", "complexity", "binary", and "ranked", each selecting a subset of the indicators. Setting indic="all" selects all indicators but "ppos", "vpos", "nvolat", "integr", "degrad", "bad", "prec", and "insec" that require an additional argument list.

with.missing

logical: should non-void missing values be treated as a regular state? If FALSE (default) missing values are ignored.

ipos.args

list: when any of "ppos", "nvolat", "vpos", or "integr" is requested, the arguments passed to seqipos together with seqdata and with.missing. See seqipos

prec.args

list: when any of "degrad", "bad", "prec", or "insec" is requested, the arguments passed to the underlying functions together with seqdata and with.missing. See seqprecarity and seqibad.

w

real in range [0,1]: when volat weight coefficient passed to seqivolatility. Default is .5.

Details

The number of visited states is the number of different elements in the sequence, e.g. 2 for aababba. The recurrence index 'recu' is the average number of visits of visited states, i.e. Dlgth/Visited, the number of spells on the number of visited states.

The sequence length, number of transitions, longitudinal entropy, duration standard deviation, volatility, complexity, turbulence, degradation, badness, precarity, and insecurity are computed respectively with functions seqlength, seqtransn, seqient, seqivardur, seqivolatility, seqici, seqST, seqidegrad, seqibad, seqprecarity, and seqinsecurity. The proportion of positive states, normative volatility, and integrative potential are computed with seqipos. See corresponding help pages for details.

The proportion of positive states ('ppos') and the normative volatility ('nvolat') are the proportions of positive elements in respectively the original sequences and the DSS. They ignore the value of dss in the ipos.args list.

The with.missing argument applies to all indicators but the length. 'lgth' returns the length obtained with with.missing=TRUE, and 'nonm' the length obtained with with.missing=FALSE.

Value

A data frame with the selected indicators. Names are:
Lght: Length of the sequence
NonM: Number of non-missing elements
Dlgth: Number of spells (length of DSS)
Visited: Number of visited states
Visitp: Proportion of states visited
Recu: Recurrence: average number of visits to visited states
Trans: Number of transitions (state changes)
Transp: Number of state changes as a proportion of maximum number of transitions
Entr: Longitudinal entropy
Meand: Mean spell duration
Dustd: Duration standard deviation
Meand2: Mean spell duration taking non visited states into account
Dustd2: Duration standard deviation taking non visited states into account
Nsubs: Number of subsequences of the DSS sequence
Volat: Objective volatility
Cplx: Complexity
Turb: Turbulence
Turbn: Normalized turbulence
Turb2: Turbulence taking non visited states into account
Turbn2: Normalized turbulence taking non visited states into account
Ppos: Proportion of positive states
Nvolat: Normative volatility (proportion of positive spells)
Vpos: Objective volatility of positive-negative state sequences
Integr: Integrative capacity (potential)
Degrad: Degradation
Bad: Badness
Prec: Precarity
Insec: Insecurity

Author(s)

Gilbert Ritschard

References

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")}.

See Also

seqlength, seqtransn, seqient, seqivardur, seqivolatility, seqici, seqST, seqidegrad, seqibad, seqprecarity, seqinsecurity, seqipos.

Examples

data(ex1)
sx <- seqdef(ex1[,1:13], right="DEL")
print(sx, format='SPS')
seqindic(sx, indic=c("lgth","nonm","visited","turbn","cplx"))
seqindic(sx, indic=c("lgth","nonm","visited","turbn","cplx"), with.missing=TRUE)
seqindic(sx, indic=c("lgth","dlgth","ppos","integr","prec"), with.missing=TRUE,
          ipos.args=list(pos.states=c("A","B")),
          prec.args=list(state.order=c("A","B","C"), state.equiv=list(c("C","D"))))
seqindic(sx, indic=c("volat","binary"), ipos.args=list(pos.states=c("A","B")))
seqindic(sx, indic=c("basic","integr"), ipos.args=list(pos.states="D"))

TraMineR documentation built on May 29, 2024, 5 a.m.