Hi
Thanks for your response. Here is a reprex:
install.packages("poLCA")
library(poLCA)
data("values")
f.values<-cbind(A, B, C) ~ 1
M1 <- poLCA(f.values, data = values, nclass= 2, graphs = TRUE, na.rm = TRUE)
Based on the latent class modelling i decide on a two-class model as the best fit. Now I would like to generate a discrete variable out of the latent class model, where the respondents in the first class in the latent class model gets the value 1 and the respondents in the second class gets the value 2. We can call the variable 'valueclass'. Then i would like to make a two-way table with 'D' as the first variable and 'valueclass' as the other variable. Can you help?