data.blca {BayesLCA} | R Documentation |
Conveniently format data for use with blca
.
data.blca(X)
X |
A data matrix intended for latent class analysis. See details. |
The data may take of one of two forms, either as a binary matrix, or as a matrix consisting of unique binary rows, with a column of counts. In either case data.blca
will convert X into a list, with binary matrix and count vector explicitly identified.
A list of class data.blca, containing
counts.n |
A vector of counts of each unique data entry. |
data |
A matrix consisting of each unique data entry. |
This function is used internally by blca
, so its use is not necessary, though it will speed up computation time to supply the model with data of this form if repeated use of a function is required.
Arthur White
type1 <- c(0.8, 0.8, 0.2, 0.2)
type2 <- c(0.2, 0.2, 0.8, 0.8)
x<- rlca(1000, rbind(type1,type2), c(0.6,0.4)) ##Only 16 unique observations possible
data.blca(x)