MEDseq (version 1.2.0)

get_MEDseq_results: Extract results from a MEDseq model

Description

Utility function for extracting results of submodels from "MEDseq" objects when a range of models were run via MEDseq_fit.

Usage

get_MEDseq_results(x,
                   what = c("z", "MAP", "DBS", "ASW"), 
                   rank = 1L, 
                   criterion = c("bic", "icl", "aic", "dbs", 
                                 "asw", "cv", "nec", "loglik"), 
                   G = NULL, 
                   modtype = NULL, 
                   noise = TRUE, 
                   ...)

Arguments

x

An object of class "MEDseq" generated by MEDseq_fit or an object of class "MEDseqCompare" generated by MEDseq_compare.

what

A character string indicating the desired results to extract.

rank

A number indicating what rank model results should be extracted from, where the rank is determined by criterion. Defaults to 1, i.e. the best model.

criterion

The criterion used to determine the ranking. Defaults to "bic".

G

Optional argument giving the number of components in the model for which results are desired. Can be supplied with or without also specifying modtype.

modtype

Optional argument giving the desired model type for which results are desired. Can be supplied with or without also specifying G.

noise

A logical indicating whether models with a noise component should be considered. Defaults to TRUE.

...

Catches unused arguments.

Value

The desired results extracted from the MEDseq model.

Details

The arguments rank and criterion are invoked when one or more of the arguments G and modtype are missing. Thus, supplying G and modtype allows rank and criterion to be bypassed entirely.

See Also

MEDseq_fit, plot.MEDseq

Examples

Run this code
# NOT RUN {
data(biofam)

# mod <- MEDseq_fit(seqdef(biofam[10:25] + 1L), G=9:10)

# Extract the MAP clustering of the best 9-cluster model according to the asw criterion
# get_MEDseq_results(mod, what="MAP", G=9, criterion="asw")

# Extract the DBS values of the best UUN model according to the dbs criterion
# get_MEDseq_results(mod, what="DBS", modtype="UUN", criterion="dbs")
# }

Run the code above in your browser using DataLab