This is my first Statalist post. I’m trying to use marginsplot to graph predicted probabilities after using gsem to estimate a multinomial, two-level logistic regression with random intercepts only. Specifically, I’m trying to visually compare the probabilities for two outcomes (other than the base outcome) in response to the same continuous predictor.
First, can someone point me to a good example for how to do something like this, showing the steps from gsem to margins to marginsplot?
Second, I’m mainly getting stalled in margins, which just hangs until I break it. Is it normal for margins to take much more time to run than the gsem estimation?
Also, does margins (and marginsplot) need the data to be in active memory, or can I use the commands after restoring the estimates from a previously saved gsem command? When I try to use them on restored estimates, I get this error message: “e(sample) does not identify the estimation sample.”
First, can someone point me to a good example for how to do something like this, showing the steps from gsem to margins to marginsplot?
Second, I’m mainly getting stalled in margins, which just hangs until I break it. Is it normal for margins to take much more time to run than the gsem estimation?
Also, does margins (and marginsplot) need the data to be in active memory, or can I use the commands after restoring the estimates from a previously saved gsem command? When I try to use them on restored estimates, I get this error message: “e(sample) does not identify the estimation sample.”
- I’ve tried setting margins to noesample, but this seems to return all the predicted values as zeros.
- I’ve tried setting e(sample) to include the variables in the model, but of course, there are “no variables defined” with restored estimates.
Comment