get_results.latents_family_enumeration: Tables of a group-class family enumeration

View source: R/additive-compare.R

get_results.latents_family_enumerationR Documentation

Tables of a group-class family enumeration

Description

The result of enumerate_classes(family = ) with group-class families: one fitted candidate per family, between-variance restriction and number of group classes.

Usage

## S3 method for class 'latents_family_enumeration'
get_results(
  x,
  what = c("candidates", "best"),
  criterion = c("bic", "aic", "bic_individual"),
  ...
)

## S3 method for class 'latents_family_enumeration'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

## S3 method for class 'latents_family_enumeration'
print(x, ...)

## S3 method for class 'latents_family_enumeration'
summary(object, ...)

Arguments

x

A latents_family_enumeration result.

what

"candidates" (one row per candidate) or "best" (the candidate with the lowest value of criterion).

criterion

"bic" (penalized by the number of groups, the default), "aic" or "bic_individual".

...

Unused.

row.names, optional

Unused; part of the generic.

object

A latents_family_enumeration result.

Value

A base data.frame, one row per candidate: model (the code candidate_fit() takes), family, between_variance, n_group_classes, log_likelihood, n_parameters, aic, bic, bic_individual, relative entropy, smallest_class, min_effective_groups, converged, boundary, n_best_replicated, and the candidate's warnings and error. With one group class every family is the same model, so those rows share a likelihood.

Examples

set.seed(1)
ratings <- data.frame(
  team = rep(seq_len(40), each = 6),
  climate = rep(rnorm(40, rep(c(-1, 1), each = 20), 0.5), each = 6) +
    rnorm(240))
grid <- enumerate_classes(ratings, "climate", "team",
                          family = c("additive", "dispersion"),
                          n_group_classes = 1:2, n_starts = 3, seed = 1)
get_results(grid)
get_results(grid, "best")

latents documentation built on Oct. 16, 2026, 5:09 p.m.