seqibad: Badness index

View source: R/seqibad.R

seqibadR Documentation

Badness index


Badness index of each sequence, i.e. the sum of undesirableness of each state weighted by the potential to integrate that state in the sequence.


  seqibad(seqdata, pow=1, with.missing=FALSE, ...)



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


real. Exponent applied to the position in the sequence. Higher value increase the importance of recency (see seqintegration). Default is 1.


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


arguments such as stprec or state.order required by seqprecstart to determine/normalize the state undesirableness degrees.


For each sequence, the badness is the sum of the undesirableness of each state weighted by the potential to integrate the state. As long as pow is strictly greater than zero, the undesirableness of states occurring at the end of the sequence get higher weights than those at the beginning. The index reaches its maximum 1 for a sequence made of a single spell in the worst state and the minimum 0 for a sequence made of a single spell is the most favorable state.


A vector with the badness index for each sequence.


Gilbert Ritschard


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

seqintegr, seqidegrad, seqprecarity


sx <- seqdef(ex1[,1:13], right="DEL")

seqibad(sx) ## using original alphabet order
seqibad(sx, stprec=c(1,2,3,6)) ## user defined undesirableness values
seqibad(sx, with.missing=TRUE, state.order=c('A','B','C','D'))

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