seqtrate {TraMineR} | R Documentation |
Returns a matrix with transition rates between states, computed from a set of sequences.
seqtrate(seqdata, statl=NULL)
seqdata |
a sequence object as defined by the seqdef function. |
statl |
a list of states or events for which the transition rates will be computed. If omitted (default), transition rates are computed between the distinct states in seqdata (obtained with the alphabet function). |
Transition rates are the probabilities of transition from one state to another observed in the sequence data. Substitution costs based on transition rates can be used when computing distances between sequences with the optimal matching method (see seqdist).
a matrix of dimension ns*ns, where ns is the number of states in the alphabet of the sequence object.
## Loading the 'actcal' example data set data(actcal) ## Defining a sequence object with data in columns 13 to 24 ## (activity status from january to december 2000) actcal.seq <- seqdef(actcal,13:24,informat='STS') ## Computing transition rates seqtrate(actcal.seq) ## Computing transition rates between states "A" and "B" only seqtrate(actcal.seq, c("A","B"))