seqetm | R Documentation |
This function automatically creates a transition-definition matrix from a state sequence object to transform the state sequences into time stamped event sequences (in TSE format).
seqetm(seqdata, method = "transition", use.labels = TRUE, sep = ">",
bp = "", ep = "end", seq)
seqdata |
State sequence object from which transition events will be determined |
method |
The method to use. One of |
use.labels |
If |
sep |
Separator to be used between the from-state and to-state that define the transition ("transition" method). |
bp |
Prefix for beginning of period event names ( |
ep |
Prefix for end of period event names ( |
seq |
Deprecated. Use |
Warning!!!: State labels should not contain commas ","
which are reserved for separating multiple events of a same transition!
One of three methods can be selected with the method
argument:
"transition"
generates a single (from-state > to-state) event for each found transition and a distinct start-state event for each different sequence start;
"period"
generates a pair of events (end-state-event, start-state-event) for each found transition, a start-state event for the beginning of the sequence and an end-state event for the end of the sequence; names used for end-state and start-state names can be controlled with the bp
and ep
arguments;
"state"
generates only the to-state event of each found transition (useful for analysing state sequences with methods for event sequences);
The transition-definition matrix.
Matthias Studer (with Gilbert Ritschard for the help page)
seqformat
for converting to TSE format,
seqecreate
for creating an event sequence object,
seqdef
for creating a state sequence object.
## Creating a state sequence object from columns 13 to 24
## in the 'actcal' example data set
data(actcal)
actcal.seq <- seqdef(actcal,13:24,
labels=c("FullTime", "PartTime", "LowPartTime", "NoWork"))
## Creating a transition matrix, one event per transition
seqetm(actcal.seq,method = "transition")
## Creating a transition matrix, single to-state events
seqetm(actcal.seq,method = "state")
## Creating a transition matrix, two events per transition
seqetm(actcal.seq,method = "period")
## changing the prefix of period start event.
seqetm(actcal.seq,method = "period", bp="begin")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.