TraMineR (version 2.2-0.1)

seqprecarity: Precarity index

Description

The precarity index returned by the function seqprecarity is a modified complexity index that takes account of the ordering (possibly only partial order) of the states and the precarity degree of the first state in the sequence. The signed proportions (transition-based weighted proportions of negative transitions) used for setting the default correction factor can be extracted per se by means of the function seqprecorr. (See details.)

Usage

seqprecarity(seqdata, correction=NULL, otto=.2, a=1, b=1.2,
    stprec=NULL, method="TRATEDSS",
    state.order=alphabet(seqdata, with.missing), state.equiv=NULL,
    with.missing=FALSE, ...)

seqprecorr(seqdata, state.order=alphabet(seqdata, with.missing), state.equiv=NULL, penalized="BOTH", method="TRATEDSS", weight.type="ADD", stprec=NULL, with.missing=FALSE, border.effect = 10, tr.type)

Arguments

seqdata

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

correction

Vector of non-negative correction factor values. If NULL, the correction factors are set as 1 minus the value returned by seqprecorr.

otto

Scalar in the range [0,1]. Trade-off weight between the precarity degree of the initial state and the corrected complexity. Default is otto=.2.

a

Non-negative real value. Exponent weight of the complexity. Default is 1.

b

Non-negative real value. Exponent weight of the correction factor. Default is 1.2.

stprec

Vector of state precarity degrees. If NULL the values are derived from the state order using seqprecstart. If not NULL, the values will be normalized by their maximum.

state.order

Vector of short state labels defining the order of the states. First the less precarious (most positive) state and then the other states in increasing precariousness order. States of the alphabet that are not included here (and are not equivalent to one of the listed state) define the non-comparable states.

state.equiv

List of state equivalence classes. Each class in the list is given as the vector of the short labels of the states forming the class.

method

One of 'FREQ', 'FREQ+', 'TRATE', 'TRATE+', 'TRATEDSS' (default), 'TRATEDSS+', 'RANK', 'RANK+', or 'ONE'. Method for determining transition weights. Weights based on transition probabilities: 'FREQ' overall frequency of the transitions, 'TRATE' transition probabilities, and 'TRATEDSS' transition probabilites in the DSS sequences. 'RANK' differences between state precarity degrees. 'ONE' no weight. With the + form the returned penalty is adjusted by the mean transition weight in the sequence.

weight.type

One of 'ADD' (default), 'INV', or 'LOGINV'. When method is one of 'FREQ', 'TRATE' or 'TRATEDSS', how weights are derived from the transition probabilities: 'ADD' additive (1-p), 'INV' inverse (1/p), and 'LOGINV' log of inverse. Ignored when any other method is selected.

penalized

One of 'BOTH' (default), 'NEG', 'POS', or 'NO'. What should be penalized or rewarded? 'NEG' only negative transitions, POS only positive transitions (with negative penalization), 'BOTH' penalize negative transitions and reward positive ones, NO no penalization. Can also be logical with TRUE equivalent to 'BOTH' and FALSE equivalent to 'NO'.

with.missing

Logical. Should the missing state be considered as an element of the alphabet?

border.effect

Value (strictly greater than 1) used to adjust estimated transition probabilities to avoid border effect. Default is 10. See details.

tr.type

Deprecated. Use method instead.

...

Arguments passed to seqprecorr

Value

For seqprecarity, an object of class seqprec with the value of the precarity index for each sequence. The returned object has an attribute stprec that contains the state precarity degree used at the starting position. The associated print method (print.seqprec) prints the state precarity values without the additional attribute.

For seqprecorr, an object of class seqprecorr with the weighted proportions \(q(x)\) and as additional attributes: tr the used transition weights; signs the transitions signs; state.noncomp the non-comparable states; and state.order the used state order. The associated print method (print.seqprecorr) prints the \(q(x)\) values without the additional attributes.

Details

The precarity index of a sequence \(x\) is based on the complexity index (Gabadinho et al., 2010) \(c(x)\) (See the seqici function) and is defined as

$$prec(x) = \lambda a(x_1) + (1-\lambda) r(x)^\beta c(x)^\alpha$$

where \(a(x_1)\) is the degree of precarity (argument stprec) of the starting state in sequence \(x\), \(r(x)\) is the correction factor (argument correction) for the sequence. The \(\lambda\) parameter (argument otto) determines the trade-off between the importance of the precarity of the starting state and of the corrected complexity index. Parameters \(\alpha\) and \(\beta\) (argument a and b) are exponent weights of respectively the complexity and the correction factor.

When correction = NULL (default), \(r(x)\) is determined as \(r(x) = 1 + q(x)\), where the penalty \(q(x)\) is the difference between the weighted proportion of negative and positive transitions. This penalty \(q(x)\) can be obtained separately by means of the function seqprecorr. The argument penalized allows to chose between three strategies for computing \(q(x)\): only penalizing negative weights (in which case \(q(x)\) is the proportion of negative transitions), only rewarding (with negative penalties) positive transitions, and applying both positive and negative penalties. The transitions can be weighted and the type of transition weights used is selected with the method argument. For weights based on transition probabilities, the way how theses probabilites are transformed into weights is controlled with weight.type. To avoid a border effect, when any computed transition probability \(p\) is close from 1 (\(p > 1 - .1/d\)), all \(p\)'s are adjusted as \(p - p/d\), where \(d\) is the border.effect parameter.

When equivalent classes are provided, the class mean precarity degree is assigned to each state of the class (see seqprecstart). For the count of transitions a same state value is assigned to all equivalent states.

Non-comparable states (those not listed on the state.order argument and not equivalent to a listed state) all receive the mean value (.5) as state precarity degree. Transitions from and to non-comparable states are ignored and replaced by a transition between the states that immediately precede and follow a spell in non-comparable states.

When there are missing states in the sequences, set with.missing = TRUE to treat the missing state as an additional state. In that case the missing state will be considered as non-comparable unless you include the nr attribute of seqdata in state.order or state.equiv. With with.missing = FALSE, transitions to and from the missing state will just be ignored. However, when with.missing = FALSE, there will be no stprec value for the missing state and, as a result, the precarity value will be NA for sequences starting with a missing state. To drop these starting missing states, use left='DEL' in seqdef when defining the state sequence object.

References

Ritschard, G., Bussi, M., and O'Reilly, J. (2018), "An index of precarity for measuring early employment insecurity", in G. Ritschard, and M. Studer, Sequence Analysis and Related Approaches: Innovative Methods and Applications, Series Life Course Research and Social Policies, Vol. 10, pp 279-295. Cham: Springer.

Gabadinho, A., Ritschard, G., Studer, M. and M<U+00FC>ller, N.S. (2010), "Indice de complexit<U+00E9> pour le tri et la comparaison de s<U+00E9>quences cat<U+00E9>gorielles", In Extraction et gestion des connaissances (EGC 2010), Revue des nouvelles technologies de l'information RNTI. Vol. E-19, pp. 61-66.

See Also

seqici, seqprecstart, seqindic.

Examples

Run this code
# NOT RUN {
## Defining a sequence object with columns 13 to 24
## in the 'actcal' example data set
data(actcal)
actcal <- actcal[1:200,] ## Here, only a subset
actcal.seq <- seqdef(actcal[,13:24])

## precarity using the original state order
prec <- seqprecarity(actcal.seq)
ici <- seqici(actcal.seq) ## complexity

seqn <- seqformat(actcal.seq, to="SPS", compress=TRUE)
tab <- data.frame(seqn,ici,prec)
names(tab) <- c("seq","ici","prec")
head(tab)

## Assuming A and B as equivalent regarding precarity
prec2 <- seqprecarity(actcal.seq, state.equiv=list(c('A','B')))
tab <- cbind(tab,prec2)
names(tab)[ncol(tab)] <- "prec2"

## and letting C be non-comparable
prec3 <- seqprecarity(actcal.seq, state.order=c("A","B","D"),
  state.equiv=list(c('A','B')))
tab <- cbind(tab,prec3)
names(tab)[ncol(tab)] <- "prec3"
head(tab)

## Extracting the q(x) used for the correction factor (1-q(x))
q <- seqprecorr(actcal.seq, state.order=c("A","B","D"),
  state.equiv=list(c('A','B')))
## correction factor
corr.f <- 1 + q
## number of non neutral correction factors
length(corr.f[corr.f != 1])

## Precarity with rank-based transition weights
prec.rank <- seqprecarity(actcal.seq, method='RANK')

## Precarity in presence of missing values:
##  missing state treated as an additional state
data(ex1)
## by default right missings are dropped from the sequences
s.ex1 <- seqdef(ex1[,1:13])
seqprecarity(s.ex1, with.missing=TRUE)


# }

Run the code above in your browser using DataLab