tse_classify: Assign observations to latent classes (Step 2)

View source: R/tse_classify.R

tse_classifyR Documentation

Assign observations to latent classes (Step 2)

Description

Computes posterior class-membership probabilities from a fitted measurement model, assigns observations to classes, and estimates the classification-error probabilities D_{ts} = P(W = s \mid X = t) between the true class X and the assigned class W. These error probabilities are what the bias-adjusted Step-3 estimators (BCH and ML) correct for.

Usage

tse_classify(
  object,
  newdata = NULL,
  assignment = c("modal", "proportional"),
  control = NULL
)

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

Arguments

object

A measurement model from tse_lca() (two or more classes).

newdata

Optional data frame to classify. Omitted: the data the measurement model was estimated on.

assignment

"modal" (default): each observation is assigned to its most likely class. "proportional": each observation is assigned to every class with its posterior probability as weight.

control

Estimation settings; default: those of object. See tse_control().

x

A tseLCA_classify object.

digits

Number of significant digits to print.

...

Unused.

Details

The measurement model is held fixed. With newdata, observations from another sample are classified with it, e.g. to relate the classes to covariates observed only in a subsample; the uncertainty of the measurement model is then still that of the sample it was estimated on.

Value

A tseLCA_classify object with components posteriors (n x T), classifications (modal classes), weights (the assignment weights P(W = s \mid Y_i)), D (the T x T classification-error matrix), entropy.R2 (computed from these posteriors, relative to the entropy of the class proportions), and data. Pass it to the Step-3 functions.

References

Vermunt, J. K. (2010). Latent class modeling with covariates: Two improved three-step approaches. Political Analysis, 18(4), 450–469. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/pan/mpq025")}

Examples

d <- generate_data(500, "high", "covariate", seed = 1)
m <- tse_lca(cbind(Y1, Y2, Y3, Y4, Y5, Y6) ~ 1, data = d, nclass = 3)
cl <- tse_classify(m)
cl
tse_classify(m, assignment = "proportional")

# classify another sample with the same measurement model
tse_classify(m, newdata = d[1:200, ])

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