seqtrate {TraMineR} | R Documentation |

## Compute transition rates between states

### Description

Returns a matrix with transition rates between states, computed from a set of sequences.

### Usage

```
seqtrate(seqdata, sel.states = NULL, time.varying = FALSE, weighted = TRUE,
lag = 1, with.missing = FALSE, count = FALSE, statl)
```

### Arguments

`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 |

### Details

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

### Value

a matrix of dimension `ns*ns`

, where `ns`

is the number of states in the alphabet of the sequence object.

### Author(s)

Matthias Studer, Alexis Gabadinho, and Gilbert Ritschard

### References

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.

### See Also

### Examples

```
## 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)
```

*TraMineR*version 2.2-10 Index]