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-
How to Estimate Unobservable Time-Specific Shocks on Dependent Variables?I have a problem that deals with human capital. Given Wit=KitRt where human capital Kit is unobserva…
Why do results of teffects versus psmatch2 differ so much?I use teffects and psmatch2 to check if they produce same results. They do not. Below is the code. W…
Omitted Variables Interaction ReghdfeHello, If this has been answered somewhere else, please direct me to the correct thread. I tried loo…
Citing stataHello, can anyone advise what these citations would be classed as: https://www.stata.com/support/faq…
How do you write a file path to use a file on Google Drive?I have a .dta file stored in a folder on Google Drive. The URL is https://drive.google.com/drive/fol…
Subscribe to:
Post Comments (Atom)
0 Response to one less class in latent class analysis with -gsem-
Post a Comment