Dear all,
I have worked on latent class/finite mixture models with earlier STATA Versions. One postestimation that I find convenient and want to "replicate" with STATA 15 is supposed to do the following:
I estimate a 2-component Finite Mixture Model. After the estimation I want to have a closer look at the observations in the 2 classes/components. With Stata Versions earlier than STATA 15, I did the following:
predict yhat1 if e(sample), eq(component1)
predict yhat2 if e(sample), eq(component2)
predict pria if e(sample), pri eq(component1)
predict posa if e(sample), pos eq(component1)
gen comp1_1 = (posa>0.5)
replace comp1_1=2 if comp1_1==0
tabstat yhat* pria posa, by(comp1_1) stat(mean sd n)
tabstat var1 var2 var3 var4, by(comp1_1)
browse var1 var 2 var3 var4 if comp1_1==1
Unfortunately, this does not work with STATA15, as there has been some changes with the "predict" command. The error message is: "option pri not allowed". I have searched the Stata Finite Mixture Models Reference Manual Version 15 but could not find anything on this.
Could anyone help me here? My aim is to generate the dummy variable "comp1_1" which indicates to which latent class the model assigns the respective Observation. With this I can then have a deeper look into the ex ante-unobserved components. However, as the "comp1_1 variable crucially depends on pria/posa above and this command does not work, i am currently stuck and do not know how to generate this indicator with the new fmm command in STATA15.
Thanks so much in advance!
Cheers,
John
I have worked on latent class/finite mixture models with earlier STATA Versions. One postestimation that I find convenient and want to "replicate" with STATA 15 is supposed to do the following:
I estimate a 2-component Finite Mixture Model. After the estimation I want to have a closer look at the observations in the 2 classes/components. With Stata Versions earlier than STATA 15, I did the following:
predict yhat1 if e(sample), eq(component1)
predict yhat2 if e(sample), eq(component2)
predict pria if e(sample), pri eq(component1)
predict posa if e(sample), pos eq(component1)
gen comp1_1 = (posa>0.5)
replace comp1_1=2 if comp1_1==0
tabstat yhat* pria posa, by(comp1_1) stat(mean sd n)
tabstat var1 var2 var3 var4, by(comp1_1)
browse var1 var 2 var3 var4 if comp1_1==1
Unfortunately, this does not work with STATA15, as there has been some changes with the "predict" command. The error message is: "option pri not allowed". I have searched the Stata Finite Mixture Models Reference Manual Version 15 but could not find anything on this.
Could anyone help me here? My aim is to generate the dummy variable "comp1_1" which indicates to which latent class the model assigns the respective Observation. With this I can then have a deeper look into the ex ante-unobserved components. However, as the "comp1_1 variable crucially depends on pria/posa above and this command does not work, i am currently stuck and do not know how to generate this indicator with the new fmm command in STATA15.
Thanks so much in advance!
Cheers,
John
Comment