seqivardur | R Documentation |
Variance of spell durations of individual state sequences.
seqivardur(seqdata, type=1, with.missing=FALSE)
## S3 method for class 'seqivardur'
print(x, stat='var', ...)
seqdata |
a state sequence object ( |
type |
either 1 or 2. The default |
with.missing |
logical: should non-void missing values be treated as a regular state? If |
x |
an outcome of |
stat |
string or vector of strings. Duration statistic to be printed. Either |
... |
further arguments such as |
The returned variance is a population variance, i.e. the sum of squares divided by the number of terms.
When type=1
, this is the variance of the observed spells in the sequence. When type=2
, in addition to the observed spells one spell of length 0 is considered for each non-visited state. The mean duration is computed the same way.
A numeric vector with the variance of spell duration of each sequence.
The returned object has two attributes:
vmax |
the maximum value that the variance of each sequence could reach given its number of spells. |
meand |
the mean spell duration of each sequence. |
Gilbert Ritschard
Ritschard, G. (2023), "Measuring the nature of individual sequences", Sociological Methods and Research, 52(4), 2016-2049. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/00491241211036156")}.
seqdur
, seqindic
sq.dat <- c('AAAA','AAAC','ABC','ABAA','AC')
sq <- seqdef(seqdecomp(sq.dat, sep=''), right=NA)
seqivardur(sq, type=1)
seqivardur(sq, type=1, with.missing=TRUE)
vd2 <- seqivardur(sq, type=2)
print(vd2, stat='all')
vd2m <- seqivardur(sq, type=2, with.missing=TRUE)
print(vd2m, stat=c('var','vmax'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.