seqmeant: Mean durations in each state

View source: R/seqmeant.R

seqmeantR Documentation

Mean durations in each state


Compute the mean total time spent in each state of the alphabet for the set of sequences given as input.


seqmeant(seqdata, weighted=TRUE, with.missing=FALSE, prop=FALSE, serr=FALSE)



a sequence object as defined by the seqdef function.


logical: if TRUE, the weights (weights attribute) attached to the sequence object are used for computing weighted mean total time.


logical: if set to TRUE, cumulated durations are also computed for the missing status (gaps in the sequences). See seqdef on options for handling missing values when creating sequence objects.


logical: if TRUE, proportions of time spent in each state are returned instead of absolute values. This option is especially useful when sequences contain missing states, since the sum of the state durations may not be the same for all sequences.


logical: if TRUE, the variance and standard deviation of the total time spent in the states, as well as the standard error of the mean are also computed.


An object of class stslist.meant. There are print and plot methods for such objects.


Alexis Gabadinho


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

plot.stslist.meant for basic plots of stslist.meant objects and seqmtplot (seqplot with type="mt") argument for more sophisticated plots of the mean durations allowing grouping and legend.


## Defining a sequence object with columns 13 to 24
## in the actcal example data set
actcal.lab <- c("> 37 hours", "19-36 hours", "1-18 hours", "no work")
actcal.seq <- seqdef(actcal,13:24,labels=actcal.lab)

## Computing the mean time in the different states

## Mean times with their standard error 
seqmeant(actcal.seq, serr=TRUE)

TraMineR documentation built on May 29, 2024, 5 a.m.