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.
Related Posts with Random slopes and random effects with melogit and xtmelogit
Regression tables with esttab - display confidence interval & p-valueHi, I am using esttab to create tables after logistic regression. I present the OR & the 95%CI …
Help for analysis method in field trialHi My study is about finding the most effective intervention to reduce the risk factors of non-comm…
Label firms with certain consecutive criteriaHi there, This sounds silly but i am stuck here for a while. I have a question regarding labelling f…
Calculate mean of each quantile/decile and get output in excel formatDear, Greetings. I like to calculate mean of each quantile on each date and take the output into a …
Choosing between OLS, RE and FEDear Statalisters, I have an unbalanced panel data (N=19 and T=9), I want to choose between runnin…
Subscribe to:
Post Comments (Atom)
0 Response to Random slopes and random effects with melogit and xtmelogit
Post a Comment