Is there anybody who can explain why this 3-classes LCA model with -gsem- command gives me only two classes?
I need to perform LCA based on single continuous measure and I have only two classes after using -gsem , lclass(C 3)- with "gsem_lca2" dataset while I'm studying how to do LCA based on a single summary measure with Stata.
** Code
cls
clear
use https://www.stata-press.com/data/r16/gsem_lca2
hist glucose
gsem ( glucose <- ) , lclass(C 3) nolog
estimates store threeclass
predict c3post*, classposteriorpr
egen max = rowmax(c3post*)
generate predclass3 = 1 if c3post1==max
replace predclass3 = 2 if c3post2==max
replace predclass3 = 3 if c3post3==max
format c3* max %9.5f
list patient glucose c3post* max predclass3 in 1/20, ab(30) noobs sep(0)
tabulate predclass3
** predclass3 | Freq. Percent Cum.
** ------------+-----------------------------------
** 2 | 119 82.07 82.07
** 3 | 26 17.93 100.00
** ------------+-----------------------------------
** Total | 145 100.00
Thanks,
Connor
Related Posts with one less class in latent class analysis with -gsem-
Merging loan data (US) with CPS via using CBSAI'm having trouble whilst trying to merge the PPP loan data from government website with the BLS's C…
How to calculate the number of posts and different categories for a certain user before time t?Hello, I encounter a question when building models in Stata. Data example: Code: * Example genera…
Interaction and factorial interaction have different significance levelI am trying to find out the effect of the interaction terms in my model. but i keep getting conflict…
AR or MA or ARMA process?Hi guys, If i wrote the formula xt = 1.004 * xt-1 + ut and yt = 1.04 * yt-1 + vt are these AR or M…
instrumenting a binary endogenous regressorHello, I am trying to run a model with a binary endogenous regressor. I am still learning econometri…
Subscribe to:
Post Comments (Atom)
0 Response to one less class in latent class analysis with -gsem-
Post a Comment