data.blca {BayesLCA} | R Documentation |
Conveniently Format Data for Bayesian Latent Class
Description
Conveniently format data for use with blca
.
Usage
data.blca(X)
Arguments
X |
A data matrix intended for latent class analysis. See details. |
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.
Value
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. |
Note
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.
Author(s)
Arthur White
See Also
Examples
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)
[Package BayesLCA version 1.9 Index]