Dear Statalisters,
I'm using Stata 15.1.
I have 6 indicators of a latent binary variable (C2), and one predictor (txcond).
If I write:
gsem (var1_2 var2_2 var3_2 var4_2 var5_2 var6_2<-, regress)(C2 <-txcond), nocapslatent lclass (C2 2)
the command works. If I want to make explicit that the 6 variables measure latent class C2,
gsem (var1_2 var2_2 var3_2 var4_2 var5_2 var6_2<-C2, regress)(C2 <-txcond), nocapslatent lclass (C2 2)
then I get the following error message: "invalid path specification;
the path from latent class variable C2 to observed variable var1_2 is not allowed"
I've noticed that the same problem doesn't occurr if I pretend my latent variable is continuous:
gsem (var1_2 var2_2 var3_2 var4_2 var5_2 var6_2<-C2, regress)(C2 <-txcond), nocapslatent latent (C2)
The reason why I want to make the relationship between the latent variable and its indicators explicit is that I'd like to actually build a model with 2 latent classes, each one with its own set of measures (but the same predictor), i.e. something like:
gsem (var1_2 var2_2 var3_2 var4_2 var5_2 var6_2<-C2, regress)(var1_3 var2_3 var3_3 var4_3 var5_3 var6_3<-C3, regress)(C2 C3<-txcond), nocapslatent lclass (C2 2)lclass (C3 2)
How can I do? I've seen the command "lclogit" is also available, but it seems to me it only allows for one latent (binary) outcome.
Federico
I'm using Stata 15.1.
I have 6 indicators of a latent binary variable (C2), and one predictor (txcond).
If I write:
gsem (var1_2 var2_2 var3_2 var4_2 var5_2 var6_2<-, regress)(C2 <-txcond), nocapslatent lclass (C2 2)
the command works. If I want to make explicit that the 6 variables measure latent class C2,
gsem (var1_2 var2_2 var3_2 var4_2 var5_2 var6_2<-C2, regress)(C2 <-txcond), nocapslatent lclass (C2 2)
then I get the following error message: "invalid path specification;
the path from latent class variable C2 to observed variable var1_2 is not allowed"
I've noticed that the same problem doesn't occurr if I pretend my latent variable is continuous:
gsem (var1_2 var2_2 var3_2 var4_2 var5_2 var6_2<-C2, regress)(C2 <-txcond), nocapslatent latent (C2)
The reason why I want to make the relationship between the latent variable and its indicators explicit is that I'd like to actually build a model with 2 latent classes, each one with its own set of measures (but the same predictor), i.e. something like:
gsem (var1_2 var2_2 var3_2 var4_2 var5_2 var6_2<-C2, regress)(var1_3 var2_3 var3_3 var4_3 var5_3 var6_3<-C3, regress)(C2 C3<-txcond), nocapslatent lclass (C2 2)lclass (C3 2)
How can I do? I've seen the command "lclogit" is also available, but it seems to me it only allows for one latent (binary) outcome.
Federico
Comment