Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

seqtabstocc

Frequencies of state co-occurrence patterns


Description

Computes the frequencies of co-occurring state patterns.

Usage

seqtabstocc(seqdata, with.missing=FALSE, ...)

Arguments

seqdata

A state sequence (stslist) object as returned by seqdef.

with.missing

Logical. Should the missing state be considered as a regular state?

...

Additional arguments to be passed to seqtab.

Details

The function extracts the list of states co-occurring in each sequence. For each sequence, the co-occurring states are extracted as the sequence of the alphabetically sorted distinct states. The frequencies of the extracted sets of states is then obtained by means of the TraMineR seqtab function.

Returned patterns with a single state correspond to sequences that contain only that state.

Value

A stslist.freq object with co-occurrence patterns sorted in descending frequency order.

Author(s)

Gilbert Ritschard

See Also

Examples

## Creating a sequence object from the first 500 actcal data.
data(actcal)
actcal.seq <- seqdef(actcal[1:500,13:24])

## 10 most frequent state patterns in the data
seqtabstocc(actcal.seq)

## All state patterns
seqtabstocc(actcal.seq, idxs=0)

## Example with missing states
data(ex1)
## adding 3 sequences with no gap and left missing state
ex1 <- rbind(ex1,c(rep("A",4),rep(NA,9)))
ex1 <- rbind(ex1,c(rep("A",4),rep(NA,9)))
ex1 <- rbind(ex1,rep("A",13))
s.ex1 <- seqdef(ex1[,1:13])
seqtabstocc(s.ex1, with.missing=TRUE)

TraMineRextras

TraMineR Extension

v0.6.1
GPL (>= 2)
Authors
Gilbert Ritschard [aut, cre, ths, cph] (<https://orcid.org/0000-0001-7776-0903>), Matthias Studer [aut] (<https://orcid.org/0000-0002-6269-1412>), Reto Buergin [aut], Tim Liao [ctb], Alexis Gabadinho [ctb], Pierre-Alexandre Fonta [ctb], Nicolas Muller [ctb], Patrick Rousset [ctb]
Initial release
2021-01-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.