Learn R Programming

MplusLGM (version 1.0.0)

getBest: Select best-fitting model from a list of Latent Growth Models (LGM)

Description

Identify and extract the best-fitting model from a list of LGM based on a specified set of criteria applied to a summary table of the models fit indices.

Usage

getBest(
  lgm_object,
  ic = c("BIC", "aBIC", "AIC", "CAIC", "AICC"),
  lrt = c("none", "aLRT", "BLRT"),
  p = 0.05
)

Value

The LGM mplusObject of the best-fitting model.

Arguments

lgm_object

A list of LGM mplusObject to evaluate.

ic

A character string specifying the information criterion (IC) to use for selecting the best-fitting model. Supported options are Bayesian Information Criterion (BIC), sample-size-adjusted BIC (aBIC), Akaike Information Criterion (AIC), Consistent Akaike Information Criterion (CAIC), and AIC corrected (AICC). The default is BIC.

lrt

A character string specifying the likelihood ratio test (LRT) to use for selecting the best-fitting model. Supported options are Bootstrap LRT (BLRT) and Lo-Mendel-Rubin adjusted LRT (aLRT). Default is "none", the selection of the the best-fitting model is only made based on the selected IC.

p

A numeric value specifying the p-value threshold for statistical significance when using LRT-based selection of the best-fitting model. Default is 0.05.

Details

The function select the best-fitting model based on the following criteria:

  • 1. Models with convergence errors are excluded.

  • 2. The model with the lowest information criterion (IC) is selected.

  • 3. If specified, the likelihood ratio test (LRT) is used to determine whether the K-class model can be reduced to K-1 classes.

  • 4. The resulting model throw a warning if it meet any of the following conditions:

    • - Entropy is below 0.5.

    • - Any class has an average posterior probability of assignment (APPA) below 0.7.

    • - Any class represents less than 5% of the sample size.

Examples

Run this code
# \donttest{
# Example usage:
GBTM_best <- getBest(
  lgm_object = GBTM_models,
  ic = "BIC",
  lrt = "aLRT",
  p = 0.05
)

best_fit <- getFit(GBTM_best)

print(best_fit)
# }

Run the code above in your browser using DataLab