extract | R Documentation |
Extract values from MixtureMissing
objects or from outputs of
select_mixture.
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
)
object |
A |
what |
The specific value to be extracted. See the return section for possible values. |
criterion |
If |
m_code |
Only used in the case when |
Available information criteria include
AIC - Akaike information criterion
BIC - Bayesian information criterion
KIC - Kullback information criterion
KICc - Corrected Kullback information criterion
AIC3 - Modified AIC
CAIC - Bozdogan's consistent AIC
AICc - Small-sample version of AIC
ICL - Integrated Completed Likelihood criterion
AWE - Approximate weight of evidence
CLC - Classification likelihood criterion
One of the following depending on what
If what = "model"
- A data frame showing the component distribution
and its abbreviation, number of clusters, and whether the data set is complete
or incomplete.
If what = "parameters"
- A list containing the relevant parameters.
If what = "cluster"
- A numeric vector of length n
indicating cluster
memberships determined by the model.
If what = "posterior"
- An n
by G
matrix where each
row indicates the expected probabilities that the corresponding observation
belongs to each cluster.
If what = "outlier"
- A logical vector of length n
indicating observations that are outliers.
Only available if model
is CN or t; NULL otherwise with a warning.
If what = "missing"
- A data frame showing how many observations (cases)
have missing values and the number of missing values per variables.
If what = "imputed"
- The original data set if it is complete; otherwise, this is
the data set with missing values imputed by appropriate expectations.
If what = "complete"
- An n
by d
logical matrix indicating which cells have no missing values.
If what = "information"
- A data frame showing the number of clusters, final observed
log-likelihood value, number of parameters, and desired information criteria.
#++++ 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.