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-
MATCHIT- Stata for data consolidation and cleaning using fuzzy string comparisonsHello, I came across your matchit command in Stata for data consolidation and cleaning using fuzzy …
How to adjust (select or handpick) correlation matrix column(s) output to be esttab after estpost correlation table?Dear Statalisters, I would like to find out whether it is possible to select the specific column(s) …
Extract substring between nth and (n+1)th commas in a variableHow can I extract a substring between the nth and (n+1)th commas in a variable? For example, consid…
Graphing variables with extreme valuesHi Statalist. I want to graph a number of financial variables, such as total household assets, and …
need help: panel data analysisHello, I have a panel data sample consisting of obervations of several years. For each year I have …
Subscribe to:
Post Comments (Atom)
0 Response to one less class in latent class analysis with -gsem-
Post a Comment