extract {MixtureMissing}R Documentation

Extractor function for MixtureMissing

Description

Extract values from MixtureMissing objects or from outputs of select_mixture.

Usage

extract(
  object,
  what = c("model", "parameters", "cluster", "posterior", "outlier", "missing",
    "imputed", "complete", "information"),
  criterion = c("AIC", "BIC", "KIC", "KICc", "AIC3", "CAIC", "AICc", "ICL", "AWE", "CLC"),
  m_code = NULL
)

Arguments

object

A MixtureMissing object or an output of select_mixture.

what

The specific value to be extracted. See the return section for possible values.

criterion

If what = "information", criterion is a vector of desired information criteria. All criteria will be extracted by default. Duplicate values in the vector will not be shown again. See the details section for a list of available information criteria.

m_code

Only used in the case when object is an output of select_mixture. If m_code = NULL, extracting will be based on the best model. If m_code is one of 'CN', 'GH', 'NIG', 'SNIG', 'SC', 'C', 'St', 't', 'N', 'SGH', 'HUM', 'H', and 'SH', the function will look for this specific model and extract accordingly.

Details

Available information criteria include

Value

One of the following depending on what

Examples


#++++ With no missing values ++++#

X <- iris[, 1:4]
mod <- MGHM(X, G = 2, model = 'GH', max_iter = 10)
extract(mod, what = "model")
extract(mod, what = "parameters")
extract(mod, what = "cluster")

#++++ With missing values ++++#

set.seed(123)
X <- hide_values(iris[, 1:4], n_cases = 20)
mod <- MGHM(X, G = 2, model = 'GH', max_iter = 10)
extract(mod, what = "outlier")
extract(mod, what = "missing")
extract(mod, what = "imputed")


[Package MixtureMissing version 3.0.2 Index]