MEDseq_meantime {MEDseq} | R Documentation |
Compute the mean time spent in each sequence category
Description
Computes the mean time (per cluster) spent in each sequence category (i.e. state value) for a fitted MEDseq
model.
Usage
MEDseq_meantime(x,
MAP = FALSE,
weighted = TRUE,
norm = TRUE,
prop = FALSE,
map.size = FALSE,
wt.size = FALSE,
SPS = FALSE)
## S3 method for class 'MEDseqMeanTime'
print(x,
digits = 3L,
...)
Arguments
x |
An object of class |
MAP |
A logical indicating whether to use the MAP classification in the computation of the averages, or the 'soft' clustering assignment probabilities given by |
weighted |
A logical indicating whether the sampling weights (if used during model fitting) are used to compute the weighted averages. These can be used alone (when |
norm |
A logical indicating whether the mean times (outputted values after the first column) are normalised to sum to the sequence length within each cluster (defaults to |
prop |
A logical (defaulting to |
map.size |
A logical (defaulting to |
wt.size |
A logical (defaults to |
SPS |
A logical indicating whether the output should be labelled according to the state-permanence-sequence representation of the central sequences. Defaults to |
digits |
Minimum number of significant digits to be printed in values. |
... |
Catches unused arguments. |
Details
Models with weights, covariates, &/or a noise component are also accounted for.
Value
A matrix with sequence category and cluster-specific mean times, giving clusters on the rows, corresponding cluster sizes (or weighted cluster sizes) in the first column, and sequence categories in the remaining columns.
Note
The function plot.MEDseq
with the option type="mt"
can be used to visualise the mean times (by cluster). However, the results displayed therein (at present) always assume norm=TRUE
, prop=FALSE
, and wt.size=TRUE
, while the MAP
argument is renamed to soft
, where MAP=!soft
.
Author(s)
Keefe Murphy - <keefe.murphy@mu.ie>
References
Murphy, K., Murphy, T. B., Piccarreta, R., and Gormley, I. C. (2021). Clustering longitudinal life-course sequences using mixtures of exponential-distance models. Journal of the Royal Statistical Society: Series A (Statistics in Society), 184(4): 1414-1451. <doi:10.1111/rssa.12712>.
See Also
MEDseq_fit
, MEDseq_control
, plot.MEDseq
Examples
data(biofam)
seqs <- seqdef(biofam[10:25] + 1L,
states = c("P", "L", "M", "L+M", "C",
"L+C", "L+M+C", "D"))
mod <- MEDseq_fit(seqs, G=10, modtype="UUN")
MEDseq_meantime(mod)
MEDseq_meantime(mod, prop=TRUE)
MEDseq_meantime(mod, map.size=TRUE)
MEDseq_meantime(mod, MAP=TRUE, norm=FALSE, SPS=TRUE)