I've been struggling with getting my marginsplot the way I would like it. I will use the example data fullauto show my problem.
Code:
clear all webuse fullauto
I have the following ordered logit model
Code:
ologit rep77 mpg i.foreign
Code:
margins, at(mpg=(10(5)45) foreign=(0(1)1)) marginsplot
In addition, I would like to have this graph with 2 curves: the predicted probabilities of outcome < 3 (so either 1 or 2), for both foreign and domestic.
Is this possible to obtain with a marginsplot?
I learned that after estimating the model, you could do the following to obtain the predicted probability for y < 3.
Code:
predict p1-p5 generate p12 = p1 + p2
I hope everything is clear. Thank you in advance

Complete do file down below
Code:
clear all webuse fullauto ologit rep77 mpg i.foreign margins, at(mpg=(10(5)45) foreign=(0(1)1)) marginsplot * The 2 graphs I would like to obtain with marginsplot ologit rep77 mpg i.foreign predict p1-p5 scatter p1 p2 mpg generate p12 = p1 + p2 scatter p12 mpg
0 Response to marginsplot after ordered logit model
Post a Comment