seqdef
) if you want to
explore state sequences, and an event sequence object (with
seqecreate
) if you are interested in event
sequencing.
State sequences are defined from a series of variables giving the
states at the successive positions, while event sequences are
defined from (vertical) time stamped event data. The package,
however, can handle many other different data organizations and
provides tools to help converting state sequences into event
sequences and vice versa.R
with the TraMineR
package:
A user's guide. Department of Econometrics and Laboratory of
Demography, University of Geneva## load the mvad data
library(TraMineR)
data(mvad)
## create a state sequence object from columns 17 to 86
mvad.seq <- seqdef(mvad[,17:86])
## distribution plot by sex (male)
seqdplot(mvad.seq, group=mvad$male, border=NA)
## compute the LCS pairwise distance matrix
## among the first 10 sequences
mvad.lcs <- seqdist(mvad.seq[1:10,], method="LCS")
Run the code above in your browser using DataLab