I'm having some trouble working out how to use margins and marginsplot to present bar charts for my Latent Class Analysis by Group.
My group LCA syntax is as follows:
Code:
gsem (Var1 Var2 Var3 Var4 Var5 Var6 <- _cons), family(bernoulli) link(logit) lclass(C 3) group(Var7) ginvariant(coef) estat lcmean estat lcprob
Code:
///Class probabilities chart margins, predict(classpr class(1)) predict(classpr class(2)) marginsplot, recast(bar) xtitle("Latent Classes") ytitle("Probabilities of Belonging to a Class") xlabel(1 "Class 1" 2 "Class 2") title("Predicted Migraine Latent Class Probabilities with 95%CI") ///Class breakdown for class 1 margins, predict(outcome (Var1) class(1)) predict(outcome (Var2) class(1)) predict(outcome (Var3) class(1)) predict(outcome (Var4) class(1)) predict(outcome (Var5) class(1)) predict(outcome (Var6) class(1)) predict(outcome (Var7) class(1)) marginsplot, recast(bar) xtitle("") ytitle("") xlabel(1 "Var1" 2 "Var2" 3 "Var3" 4 "Var4" 5 "Var5" 6 "Var6" 7 "Var7") title ("Predicted Probability of Characteristics of Class 1")
Any guidance would be greatly appreciated!
Kind regards,
Daniel Sullivan
0 Response to margins & marginsplot in LCA by group
Post a Comment