rlca {BayesLCA} | R Documentation |
A function which randomly generates data with respect to some underlying latent class. Data may be generated either by specifying item and class probabilities or by utilising an object previously fitted to data.
rlca(n, itemprob = 0.5, classprob = 1, fit = NULL)
n |
Number of data points to be generated. |
itemprob |
The item probabilities, conditional on class membership. Defaults to 0.5. |
classprob |
The class probabilities. Defaults to 1, i.e., a one class model. |
fit |
An object of class blca. If fit is supplied, data is generated using the class and item probabilities obtained. Defaults to NULL. |
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))
fit <- blca.em(x, 2)
x2<- rlca(1000, fit=fit)
fit2<- blca.em(x2,2)