Hello,
I am trying to obtain a caterpillar plot of group-level residuals and group-level predicted probabilities generated from a multilevel logistic model. For context, I have individuals at level 1 nested within groups at level 2, and I am using the "bayes: melogit".
However, I keep getting an error that says the syntax is invalid for the generate pred_prob command. Also, I am unsure how to go about obtaining a caterpillar plot using the bayes command; normally I use "serrbar" if just using xtmelogit for example. Any help would be appreciated!
Thank you!!
I am trying to obtain a caterpillar plot of group-level residuals and group-level predicted probabilities generated from a multilevel logistic model. For context, I have individuals at level 1 nested within groups at level 2, and I am using the "bayes: melogit".
Code:
bayes, prior({outcome:_cons}, flat): melogit outcome || group:, cov(un) bayes, showreffects({U0[1/16]}) egen pickone = tag(group) generate pred_prob = invlogit({outcome:_cons} + {U0[group]}) list group pred_prob if pickone==1
Thank you!!
Comment