# NOT RUN {
data("nhanes")
# Model 1: LCA
lca = glca(item(starts.with = "DPQ") ~ 1, data = nhanes, nclass = 2)
summary(lca)
# Model 2: LCA with covariate(s)
lcr = glca(item(starts.with = "DPQ") ~ AGE, data = nhanes, nclass = 3)
summary(lcr)
coef(lcr)
# Model 3: MGLCA
mglca = glca(item(starts.with = "DPQ") ~ 1, group = GENDER,
data = nhanes, nclass = 3)
summary(mglca)
# Model 4: MGLCA with covariate(s)
mglcr = glca(item(starts.with = "DPQ") ~ AGE, group = GENDER,
data = nhanes, nclass = 3)
summary(mglcr)
coef(mglcr)
# Model 5: MLCA
mlca = glca(item(starts.with = "DPQ") ~ 1, group = RACE,
data = nhanes, nclass = 3, ncluster = 2)
summary(mlca)
# }
Run the code above in your browser using DataLab