best_model: Class enumeration results

View source: R/tse_lca.R

best_modelR Documentation

Class enumeration results

Description

Methods for the tseLCA_select object returned by tse_lca() with several numbers of classes. best_model() returns the fitted model that minimizes an information criterion; x[[k]] returns the k-class model.

Usage

best_model(object, ...)

## S3 method for class 'tseLCA_select'
best_model(object, criterion = c("BIC", "AIC", "SABIC"), ...)

## S3 method for class 'tseLCA_select'
x[[i, ...]]

## S3 method for class 'tseLCA_select'
as.data.frame(x, ...)

## S3 method for class 'tseLCA_select'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

## S3 method for class 'tseLCA_select'
plot(x, which = c("AIC", "BIC", "SABIC"), ...)

Arguments

...

Further arguments passed to graphics::matplot() (plot) or unused.

criterion

Information criterion to minimize: "BIC" (default), "AIC", or "SABIC".

x, object

A tseLCA_select object.

i

Number of classes of the model to extract.

digits

Number of significant digits to print.

which

Criteria to plot.

Value

best_model() and [[: a tseLCA_measurement object. as.data.frame(): the enumeration table. print(), plot(): x, invisibly.

Examples

d <- generate_data(500, "high", "covariate", seed = 1)
sel <- tse_lca(cbind(Y1, Y2, Y3, Y4, Y5, Y6) ~ 1, data = d, nclass = 1:4)
as.data.frame(sel)
best_model(sel)
sel[[2]]

tseLCA documentation built on Nov. 11, 2026, 9:07 a.m.