Learn R Programming

TraMineR (version 2.2-1)

seqindic: 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=1)

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 successive distinct states), "visited" (number of visited states), "recu" (recurrence index), "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), "entr" (longitudinal normalized entropy), "volat" (objective volatility), "nsubs" (number of subsequences of the DSS sequence), "cplx" (complexity index), "turbn" (normalized turbulence), "turb" (turbulence), "ppos" (proportion of positive states), "nvolat" (normative volatility), "vpos" volatility of positive-negative state sequences, "inpos" (integration potential), "prec" (precarity index). Can also be "all", "basic", "diversity", "complexity", or "binary" that each select a subset of the indicators. Setting indic="all" selects all indicators but "ppos", "vpos", "nvolat", "inpos", and "prec" 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 "inpos" is requested, the arguments passed to seqipos together with seqdata and with.missing. See seqipos

prec.args

list: when "prec" requested, the arguments passed to seqprecarity together with seqdata and with.missing. See seqprecarity.

w

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

Value

A data frame with the selected indicators. Names are: Lght: Length of the sequence NonM: Number of non missing elements Dlgth: Length of the sequence of distinct successive states (DSS) Visited: Number of visited states Recu: Average number of visits to visited states Trans: Number of state changes Transp: Number of state changes as a proportion of maximum number of transitions Meand: Mean spell duration Dustd: Duration standard deviation Entr: Longitudinal entropy Volat: Objective volatility Nsubs: Number of subsequences of the DSS sequence Cplx: Complexity Turbn: Normalized turbulence Turb: Turbulence Ppos: Proportion of positive states Nvolat: Normative volatility Vpos: Volatility of positive-negative state sequences Inpos: Integrative capacity Prec: Precarity

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, volatility, duration standard deviation, complexity, turbulence, proportion of positive states, integrative potential, and precarity are computed respectively with functions seqlength, seqtransn, seqient, seqivolatility, seqivardur, seqici, seqST, seqipos, seqintegration, and seqprecarity. See corresponding help pages for details.

The proportion of positive states ('ppos') and the normative volatility ('nvolat') are the proportions of positive states 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.

See Also

seqlength, seqtransn, seqient, seqivolatility, seqivardur, seqici, seqST, seqipos, seqintegration and seqprecarity

Examples

Run this code
# NOT RUN {
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","inpos","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","inpos"), ipos.args=list(pos.states="D"))
# }

Run the code above in your browser using DataLab