Hi all,
I'm analysing findings from a discrete choice experiment, and one model I'm using is a latent class model to explore heterogeneity in preferences. After running the model and getting coefficients on two classes, I want to use these estimates for each class separately to run some post-estimation predictions. I'm unsure of how to tell Stata to distinguish between the two classes, and how to use estimations from each class separately to generate predictions.
The command I am using for the latent class model is the user contributed commands lclogit2 and lclogitml2. The code for my model is:
Inspecting the estimates after running the model by class, produces the following:
How do I use these saved estimates to run post-estimation predictions by each class separately (tell Stata to give me separate predictions for Class1 and Class2?
Many thanks.
I'm analysing findings from a discrete choice experiment, and one model I'm using is a latent class model to explore heterogeneity in preferences. After running the model and getting coefficients on two classes, I want to use these estimates for each class separately to run some post-estimation predictions. I'm unsure of how to tell Stata to distinguish between the two classes, and how to use estimations from each class separately to generate predictions.
The command I am using for the latent class model is the user contributed commands lclogit2 and lclogitml2. The code for my model is:
Code:
lclogit2 y, rand(ASC_IP ASC_MIX ASC_TH $X $X_x $Z $blocks) id(id) gr(id_cset) ncl(2) matrix from = e(b) lclogitml2 y, rand(ASC_IP ASC_MIX ASC_TH $X $X_x $Z $blocks) id(id) gr(id_cset) ncl(2) from(from) est save lc2_XxZ, replace
Code:
matrix list e(B)
e(B)[2,20]
Coef of: Coef of: Coef of: Coef of: Coef of:
ASC_IP ASC_MIX ASC_TH base_visit~M base_visitTH
Class1 6.5180372 6.1541348 5.2449522 -.12755688 .16726271
Class2 1.4586006 1.3976973 .49437823 -.08254781 -.20532341
Coef of: Coef of: Coef of: Coef of: Coef of:
base_urbanTH time_cont wait_cont wait_qd cost_cont
Class1 -.14689643 -.45008707 -.4077067 .02376927 -.01418531
Class2 -.27767452 -.29528015 -.45787678 .02667609 -.01508211
Coef of: Coef of: Coef of: Coef of: Coef of:
hub1 first_th1 time_cont~b1 time_con~th1 wait_con~th1
Class1 -.05989128 .14971095 .20593715 -.01181941 -.05975712
Class2 .4120373 -.58833088 -.09912711 .2570673 -.06389725
Coef of: Coef of: Coef of: Coef of: Coef of:
block2_NONE block3_NONE block4_NONE block5_NONE block6_NONE
Class1 1.1050251 5.4273555 .28909495 5.0739116 4.9461815
Class2 .51920226 -3.3110282 .02396668 -3.692282 -4.157104
How do I use these saved estimates to run post-estimation predictions by each class separately (tell Stata to give me separate predictions for Class1 and Class2?
Many thanks.

Comment