Hi,
I'm trying to create 3 side by side graph with the estimations from mlogit.
So this is my model and predictions:
eststo mlogit3: mlogit part c.congr##c.normal $controls, robust
sum normal if e(sample), detail
return list
mgen,at((means) $controls congr=(0(1)7) normal=(`r(p10)' `r(p50)' `r(p90)') (median) gender fed) saving(mlogitpartyinst, replace)
Now I created macros to generate the graphs:
local i=1
foreach m in .5102040767669678 .8367347121238708 .9854227304458618{
twoway (rarea _ll0 _ul0 _congr if _normal==`m', color(pink%50)) (rarea _ll1 _ul1 _congr if _normal==`m', color(green%50)) (rarea _ll2 _ul2 _congr if _normal==`m', color(navy%50)) (rarea _ll3 _ul3 _congr if _normal==`m', color(orange%50)) (line _pr0 _congr if _normal==`m', lcol(pink%50) lpat(solid)) (line _pr1 _congr if _normalt==`m', lcol(green%50) lpat(solid)) (line _pr2 _congr if _normal==`m', lcol(navy%50) lpat(solid)) (line _pr3 _congr if _normal==`m', lcol(orange%50) lpat(solid)) (hist congr if e(sample) & normal==`m', percent yaxis(2) yscale(off axis(2)) color(black%15) lcolor(white) xlab(0(1)8)), xlab(0(1)7) ylab (0(.1).8) xtitle("Distance") name(margins`i', replace) title("Party Institutionalization(`i')")
loc ++i
}
I produce the graph that I want with this code. However, I also want to include different titles for 3 graphs like this: normal (10%) normal (50%) normal (90%). I tried to do that with another local but it iterates the code 3 times for each title. How can I include the title?
I'm trying to create 3 side by side graph with the estimations from mlogit.
So this is my model and predictions:
eststo mlogit3: mlogit part c.congr##c.normal $controls, robust
sum normal if e(sample), detail
return list
mgen,at((means) $controls congr=(0(1)7) normal=(`r(p10)' `r(p50)' `r(p90)') (median) gender fed) saving(mlogitpartyinst, replace)
Now I created macros to generate the graphs:
local i=1
foreach m in .5102040767669678 .8367347121238708 .9854227304458618{
twoway (rarea _ll0 _ul0 _congr if _normal==`m', color(pink%50)) (rarea _ll1 _ul1 _congr if _normal==`m', color(green%50)) (rarea _ll2 _ul2 _congr if _normal==`m', color(navy%50)) (rarea _ll3 _ul3 _congr if _normal==`m', color(orange%50)) (line _pr0 _congr if _normal==`m', lcol(pink%50) lpat(solid)) (line _pr1 _congr if _normalt==`m', lcol(green%50) lpat(solid)) (line _pr2 _congr if _normal==`m', lcol(navy%50) lpat(solid)) (line _pr3 _congr if _normal==`m', lcol(orange%50) lpat(solid)) (hist congr if e(sample) & normal==`m', percent yaxis(2) yscale(off axis(2)) color(black%15) lcolor(white) xlab(0(1)8)), xlab(0(1)7) ylab (0(.1).8) xtitle("Distance") name(margins`i', replace) title("Party Institutionalization(`i')")
loc ++i
}
I produce the graph that I want with this code. However, I also want to include different titles for 3 graphs like this: normal (10%) normal (50%) normal (90%). I tried to do that with another local but it iterates the code 3 times for each title. How can I include the title?

Comment