I’m having a difficult time finding the way to do something that surely must be obvious.
I am running Stata 12 in Windows and trying to graph the results of an ologit equation. Specifically, after I run an ologit equation with four outcomes, I use margins to generate predicted values for each of the four outcomes. My independent variable of interest is an indicator variable with many categories, but I only want to graph three of them; so I use margins to generate the predicted values for outcomes 1-4, for each of the three groups.
I use marginsplot to create four separate connected line graphs with confidence intervals for the three groups, which I combined with graph combine:

What I would like to create is a single graph with all four outcomes.
The ologit command line is:
ologit govfollowrev age educ i.reltrad, vce(robust)
The margins command line for outcome 1 is:
margins i(100001/100003).reltrad, predict(outcome(1)) vce(unconditional)
I created a looping program to create the graphs:
forvalues i=1/4 {
margins i(100001/100003).reltrad, predict(outcome(`i')) vce(unconditional)
marginsplot
graph save C:\Users\pwielhouwer\Documents\Data\Graphs\govmarg ins`i', replace
}
And then combined the four graphs to produce the one above.
Can I please get some help in creating a single graph for all four outcomes? Thanks in advance!
I am running Stata 12 in Windows and trying to graph the results of an ologit equation. Specifically, after I run an ologit equation with four outcomes, I use margins to generate predicted values for each of the four outcomes. My independent variable of interest is an indicator variable with many categories, but I only want to graph three of them; so I use margins to generate the predicted values for outcomes 1-4, for each of the three groups.
I use marginsplot to create four separate connected line graphs with confidence intervals for the three groups, which I combined with graph combine:
What I would like to create is a single graph with all four outcomes.
The ologit command line is:
ologit govfollowrev age educ i.reltrad, vce(robust)
The margins command line for outcome 1 is:
margins i(100001/100003).reltrad, predict(outcome(1)) vce(unconditional)
I created a looping program to create the graphs:
forvalues i=1/4 {
margins i(100001/100003).reltrad, predict(outcome(`i')) vce(unconditional)
marginsplot
graph save C:\Users\pwielhouwer\Documents\Data\Graphs\govmarg ins`i', replace
}
And then combined the four graphs to produce the one above.
Can I please get some help in creating a single graph for all four outcomes? Thanks in advance!
Comment