| tse_classify | R Documentation |
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.
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), ...)
object |
A measurement model from |
newdata |
Optional data frame to classify. Omitted: the data the measurement model was estimated on. |
assignment |
|
control |
Estimation settings; default: those of |
x |
A |
digits |
Number of significant digits to print. |
... |
Unused. |
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.
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.
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")}
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, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.