Hi all
I am running a 2-level random intercepts logistic regression model (using melogit) and would like to report predicted probabilities after running the model. I can do that easily enough and store them in a variable called full_prediction using

predict full_prediction, mu

But what I really want to be able to do is to dissect these predictions into a component due to the fixed part of the model and a component due to the random intercept. The command xb generates the linear predictor of the fixed portion of the model, so I thought that maybe

predict fixed_prediction, xb

would allow me to calculate the component due to the random intercept by subtraction.

As there are no random slopes in this model (only the intercept varies randomly), I expected that the component due to the random intercept would be the same for every case in the same higher level unit. But they weren't.

Not only that, in some cases they were outside of [0,1]; as were some of the predicted probabilities due to the fixed part of the model; i.e. those derived by

predict fixed_prediction, xb

Have I misunderstood something here?


Many thanks
John