melogit CSES5govact c.CSES5corrupt c.income c.gini c.polstrust || E1003: CSES5corrupt
I'm running a two-level logit trying to get reliable random slopes for CSES5corrupt, ideally with confidence intervals. What works in melogit is not giving me a random slope common to each level 2 unit (E1003, which is country/election). The following I've got from an earlier post in the forums but it's not what I'm after.
predict fe, xb ///// linear prediction, fixed portion only
predict re, reffects reses(reses) /////empirical Bayes means for _cons[E1003]
gen predicted fe + re
gen lower_ci = predicted - 1.96*reses
gen upper_ci = predicted + 1.96*reses
but predict fe, xb is not giving me the random slope I want - it varies within the level 2 cases. So all I'm getting is the constant and its standard error from the second line of code. The next two lines are getting me a prediction for each level 1 case which I don't want.
When I run the same model in xtmelogit and use the code below I do get what I want (I think)
predict re_slope re_cons, reffects ///// creates two variables, random effects for E1003: CSEScorrupt & random effects for E1003:_cons
predict u0se u1se, reses //// re standard errors for them both
this gives me a random slope for each level 2 unit, the constant for each unit, and their standard errors.
But when I try to run this code after melogit I get 'too many variables specified'.
Anyone know how I can get these after melogit (which is faster). Melogit and xtmelogit also give slightly different results and I understand xtmelogit is an older version. And, ideally, get confidence intervals too boot? I have gone to the various help options and the manual but I'm not finding any worked examples or instructions i can make sense of.
0 Response to Random slopes and random effects with melogit and xtmelogit
Post a Comment