get_results.latents_growth_mixture: Tidy results of a growth mixture model

View source: R/growth-mixture-methods.R

get_results.latents_growth_mixtureR Documentation

Tidy results of a growth mixture model

Description

Every table of a mixture_regression() fit with ⁠random =⁠ is a base data.frame with one row per observation unit of that table.

Usage

## S3 method for class 'latents_growth_mixture'
get_results(
  x,
  what = "coefficients",
  level = 0.95,
  vcov_type = NULL,
  time = NULL,
  data = NULL,
  truth = NULL,
  ...
)

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

## S3 method for class 'latents_growth_mixture'
coef(object, ...)

## S3 method for class 'latents_growth_mixture'
vcov(object, type = NULL, ...)

## S3 method for class 'latents_growth_mixture'
confint(object, parm, level = 0.95, ...)

## S3 method for class 'latents_growth_mixture'
logLik(object, ...)

## S3 method for class 'latents_growth_mixture'
nobs(object, ...)

Arguments

x

A latents_growth_mixture fit.

what

Which table: "coefficients" (one row per class and term, with Wald statistics; shared terms have class "common"), "classes" (share with interval, expected and assigned persons, average posterior, residual standard deviation), "random" (per class: random-effect variances, standard deviations and correlations with intervals formed on the log and Fisher-z scales), "membership" (membership logits against class 1), "fit" (one row: log likelihood, information criteria with persons as the sample size, entropy, convergence), "assignments" (one row per person: modal class and posteriors), "random_effects" (one row per person: predicted random effects under the modal class), "trajectories" (one row per class and time point: the mean trajectory with a confidence band), "individual" (one row per observation: observed value, class trajectory and the person's own predicted curve), "starts" (one row per start), "recovery" (needs data and truth: the modal classes cross-tabulated against a known classification that is constant within persons, with counts and shares of each assigned class), or "all" (a named list of every table but "recovery"). A multilevel growth mixture (cluster) adds "group_classes" (one row per group class and class: the class probabilities within the group class, their standard errors without membership covariates, the group class's share of the clusters and its assigned clusters) and "clusters" (one row per cluster: persons, modal group class and posteriors); its "membership" table holds the group-class logits (against group class 1) and the class logits with one intercept per group class, "assignments" gains each person's cluster, and "fit" counts clusters in bic (persons in bic_persons).

level

Confidence level of the intervals.

vcov_type

NULL (the stored type), "observed", "robust" or "opg". A weighted fit allows "robust" only.

time

For "trajectories" and "individual", the numeric variable to draw along; by default the first numeric variable of random.

data, truth

For "recovery": the data frame the model was fitted to and the name of its column holding the known classes.

...

Unused.

row.names, optional

Unused; for the generic.

object

A latents_growth_mixture fit.

type

As vcov_type.

parm

Unused.

Value

A base data.frame (or, for "all", a named list of them).

Examples

few_students <- subset(growth_scores, student <= 60)
small_fit <- mixture_regression(score ~ wave, few_students, n_classes = 2,
                                id = "student", class_level = "group",
                                random = "intercept", seed = 1)
get_results(small_fit, "classes")
get_results(small_fit, "random")

# All 300 students, with random intercepts and slopes
fit <- mixture_regression(score ~ wave, growth_scores, n_classes = 3,
                          id = "student", class_level = "group",
                          random = "wave", random_covariance = "equal",
                          n_starts = 3, seed = 1)
get_results(fit, "classes")
get_results(fit, "random")
get_results(fit, "recovery", data = growth_scores, truth = "trajectory")


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