seqtrate | R Documentation |
Returns a matrix with transition rates between states, computed from a set of sequences.
seqtrate(seqdata, sel.states = NULL, time.varying = FALSE, weighted = TRUE,
lag = 1, with.missing = FALSE, count = FALSE, statl)
seqdata |
a sequence object as defined by the |
sel.states |
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 |
time.varying |
Logical. If |
weighted |
Logical. If |
lag |
Integer. Time between the two states considered to compute transition rates (one by default). |
with.missing |
Logical. If |
count |
Logical. Should counts of transition be returned instead of transition probabilities. Default is |
statl |
Deprecated. Use |
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.
Matthias Studer, Alexis Gabadinho, and Gilbert Ritschard
Gabadinho, A., G. Ritschard, N. S. Müller and M. Studer (2011). Analyzing and Visualizing State Sequences in R with TraMineR. Journal of Statistical Software 40(4), 1-37.
seqdist
seqsubm
alphabet
.
## 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])
## Computing transition rates
seqtrate(actcal.seq)
## Computing transition rates between states "A" and "B" only
seqtrate(actcal.seq, c("A","B"))
## ====================
## Example with weights
## ====================
data(ex1)
ex1.seq <- seqdef(ex1[,1:13], weights=ex1$weights)
seqtrate(ex1.seq, weighted=FALSE)
seqtrate(ex1.seq, weighted=FALSE, count=TRUE)
## weights are accounted for by default
seqtrate(ex1.seq)
seqtrate(ex1.seq, count=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.