Learn R Programming

TraMineRextras (version 0.4.2)

seqprecarity: Precarity index

Description

The precarity index returned by the function seqprecarity is a modified complexity index that takes account of the ordinal order (possibly only partial order) of the states and data-driven correction factors derived from the overall frequencies of the transitions occurring in the sequence. The signed proportions (transition-based weighted proportions of negative transitions) used for the 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,
    state.order=alphabet(seqdata), state.equiv=NULL, ...)

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

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 computed by means of the seqprecorr function.

otto

Scalar in the range [0,1]. Trade-off weight between the precarity level 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.

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 define the non-comparable states.

state.equiv

List of state equivalence classes. The classes in the list are each set as the vector of the short labels of the states forming the class.

tr.type

One of 'FREQ', 'TRATE', or 'TRATEDSS' (default). Type of transition probabilities used for deriving the weights: 'FREQ' overall frequency of the transitions, 'TRATE' transition probabilities, and 'TRATEDSS' transition probabilites in the DSS sequences.

weight.type

One of 'ADD' (default), 'INV', 'LOGINV', or 'NO'. How weights are derived from the transition probabilities: 'ADD' additive (1-p), 'INV' inverse (1/p), and 'LOGINV' log of inverse. When 'NO', weights do not account for the transition probabilities.

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?

...

Arguments passed to seqprecorr

Value

For seqprecarity, a vector with the value of the precarity index for each sequence. The returned vector has an attribute stprec that contains the state precarity level used at the starting position.

For seqprecorr, the vector of the weighted proportions \(q(x)\) with as additional attributes: tr the used transition probabilities; signs the transitions signs; state.noncomp the non-comparable states; and state.order the used state order.

Details

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

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

where \(a(x_1)\) is the level of precarity of the starting state in sequence \(x\), \(q(x)\) is the weighted proportion of negative transitions (or, with a negative sign, of the positive transitions) in 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.

The weighted proportion of negative transitions \(q(x)\) can be obtained separately by means of the function seqprecorr. The type of probabilities used to determine the transition weights can be controlled with tr.type. Likewise, the way how theses probabilites are transformed into weights is controlled with weight.type. The argument penalized allows to chose between three strategies: only penalizing negative weights, only rewarding (with negative penalties) positive transitions, and applying both positive and negative penalties.

When equivalent classes are provided, the transitions between states of a same class are ignored and the class mean starting precarity level is assigned to each state of the class (see seqprecstart).

As for non-comparable states (those not listed on the state.order argument), the transition to or from such states is ignored and they all receive the mean level (.5) as starting precarity.

References

Ritschard, G., Bussi, M., and O'Reilly, J. (forthcoming), "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, 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 and seqprecstart.

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])


# }

Run the code above in your browser using DataLab