Changes time granularity of a state sequence object by aggregating successive positions into groups of a user-defined time length.
seqgranularity(seqdata, tspan = 3, method = "last")
A state sequence object.
Integer. Number of successive positions grouped together.
Character string. Aggregating method. One of
Successive positions are aggregated by group of
tspan states. The aggregated state is, depending of the
method chosen, either the first (
"first"), the first valid (
"first.valid"), the last (
"last"), the last valid (
"last.valid"), or the most frequent (
"mostfreq") state of the
tspan long spell. The same applies to the last spell, even when it is shorter than
"first") and (
"last") differ from (
"first.valid") and (
"last.valid") only when sequences contain missing values and/or have different lengths.
When there are (void or non void) missings, method
"mostfreq" replaces each interval with the most frequent valid state on the interval or the missing state when there are no valid state.
End missings are set as void when there are voids in
seqdata and as the
nr attribute otherwise.
stslist object: The compacted state sequence object.
Matthias Studer and Gilbert Ritschard
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.