Learn R Programming

BayesLCA (version 1.9)

data.blca: 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.

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.

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.

See Also

blca

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab