Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

seqindic-dyn

Dynamic index


Description

Dynamic (i.e. successive) values of an individual index. For each sequence, the values of the selected index is computed on sliding windows.

Usage

seqindic.dyn(seqdata, indic="cplx", window.size = .2, sliding=TRUE,
      with.missing=FALSE, silent.indic=TRUE, ...)

Arguments

seqdata

state sequence object (stslist) as produced by seqdef

indic

character string: the individual index. Can be any value supported by seqindic except index group names.

window.size

integer or real. If an integer > 1, window size in number of positions. If real number in the range ]0,1), the window size is set as that proportion of the length of the longest sequence.

sliding

logical: Should indic be computed on sliding windows? If FALSE, windows are incremented starting with a window of size window.size.

with.missing

logical. Should the missing state be treated as a state of the alphabet?

silent.indic

logical. Should messages issued during computation of indic be suppressed?

...

additional arguments passed to seqindic

Details

The function implements the dynamic sequence analysis approach of Pelletier et al. (2020) and generalizes the method to any of the over 20 indicators provided by seqindic.

The values of the indic index are computed for each sequence either on sliding windows of size window.size or on incremental windows starting from a first window of size window.size.

Column names refer to the end the windows.

Value

A matrix of class dynin with attributes xtstep, tick.last, weights, window.size, sliding, and indic. The first three as well as the row and column names are taken from seqdata.

There are print and plot methods for dynin objects. See plot.dynin.

Author(s)

Gilbert Ritschard

References

Pelletier, D.; Bignami-Van Assche, S. & Simard-Gendron, A. (2020) Measuring Life Course Complexity with Dynamic Sequence Analysis, Social Indicators Research doi: 10.1007/s11205-020-02464-y.

See Also

Examples

data(actcal)
cases <- 1:100
actcal <- actcal[cases,] ## Here, only a subset
actcal.seq <- seqdef(actcal[,13:24], alphabet=c('A','B','C','D'))

a.dyn <- seqindic.dyn(actcal.seq, indic='cplx', with.missing=FALSE)

plot(a.dyn, group=actcal[cases,'sex'], fstat=mean)

## Trimmed mean
plot(a.dyn, group=actcal[cases,'sex'], fstat=function(x)mean(x, trim=.02))

TraMineRextras

TraMineR Extension

v0.6.1
GPL (>= 2)
Authors
Gilbert Ritschard [aut, cre, ths, cph] (<https://orcid.org/0000-0001-7776-0903>), Matthias Studer [aut] (<https://orcid.org/0000-0002-6269-1412>), Reto Buergin [aut], Tim Liao [ctb], Alexis Gabadinho [ctb], Pierre-Alexandre Fonta [ctb], Nicolas Muller [ctb], Patrick Rousset [ctb]
Initial release
2021-01-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.