rlca: Randomly Generate Binary Data with Underlying Latent Classes

Description Usage Arguments Author(s) See Also Examples

View source: R/rlca.R

Description

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.

Usage

1
rlca(n, itemprob = 0.5, classprob = 1, fit = NULL)

Arguments

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.

Author(s)

Arthur White

See Also

data.blca

Examples

1
2
3
4
5
6
7
8
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)

BayesLCA documentation built on July 2, 2020, 12:11 a.m.