compare_solutions: Compare latent profile models

Description Usage Arguments Value Author(s) Examples

View source: R/compare-solutions.R

Description

Takes an object of class 'tidyLPA', containing multiple latent profile models with different number of classes or model specifications, and helps select the optimal number of classes and model specification.

Usage

1
compare_solutions(x, statistics = "BIC")

Arguments

x

An object of class 'tidyLPA'.

statistics

Character vector. Which statistics to examine for determining the optimal model. Defaults to 'BIC'.

Value

An object of class 'bestLPA' and 'list', containing a tibble of fits 'fits', a named vector 'best', indicating which model fit best according to each fit index, a numeric vector 'AHP' indicating the best model according to the AHP, an object 'plot' of class 'ggplot', and a numeric vector 'statistics' corresponding to argument of the same name.

Author(s)

Caspar J. van Lissa

Examples

1
2
3
4
5
6
iris_subset <- sample(nrow(iris), 20) # so examples execute quickly
results <- iris %>%
  subset(select = c("Sepal.Length", "Sepal.Width",
    "Petal.Length", "Petal.Width")) %>%
  estimate_profiles(1:3) %>%
  compare_solutions()

Example output

You can use the function citation('tidyLPA') to create a citation for the use of {tidyLPA}.
Mplus is not installed. Use only package = 'mclust' when calling estimate_profiles().
Warning message:
In system2("type", args = "mplus", stdout = FALSE, stderr = FALSE) :
  error in running command
Warning message:
The solution with the maximum number of classes under consideration was considered to be the best solution according to one or more fit indices. Examine your results with care and consider estimating more classes. 

tidyLPA documentation built on Nov. 17, 2021, 5:07 p.m.