Provides predicted class memberships or posterior probabilities based on a fitted slca model.
If newdata is omitted, predictions are computed from the posterior probabilities stored in object.
Arguments
- object
An object of class
slcafit, representing a fittedslcamodel.- newdata
A
data.frame, matrix, or vector containing the same manifest variables as those used to estimate theobject. Unknown response levels are not allowed.- type
A character string indicating the type of prediction. Use
"class"to obtain the predicted class membership for each observation and latent class variable, or"posterior"to retrieve posterior probabilities for each class. The default is"class".- ...
Additional arguments passed to other methods.
Value
A data.frame or list depending on the type:
For
type = "class", adata.frameis returned where rows represent observations and columns correspond to latent class variables.For
type = "posterior", alistis returned containing one matrix for each latent class variable. Rows represent observations and columns represent latent classes.
