Hi All
I created this graph using the margins and marginsplot command post running a multinomial logistic regression model:
*Model:
* Figure:
I have two questions:
1. Is it possible to plot a 'stacked bar chart' using the marginsplot command? I'm unable to find this as an option in Stata. Currently, with the 'recast bar' option, some of the smaller predicted probabilities get hidden or covered by larger probabilities (for e.g., subgraphs B,C & D, the depression/anxiety category is not visible at all, but CIs are. A stacked bar chart would potentially get rid of this issue.
2. Is it possible to change the placement of the 95% CIs (i.e. to have small gaps betwen them) to make it easier to read over lapping CIs?
I've looked online but unable to find any information that addresses the above.
Any help would be really appreciated!
Thanks
/Amal
Bargraph-stataexample.gph
I created this graph using the margins and marginsplot command post running a multinomial logistic regression model:
*Model:
Code:
mi est, post dots rrr: mlogit mh2 i.sexual##i.ACEscore mimrgns (sexual#ACEscore), predict(default) cmdmargins
Code:
marginsplot, xdimension(ACEscore) bydimension(sexual) title("") xtitle("") recast(bar) horizontal plotopts(barwidth(0.7)) ciopts(lwidth(medthick)) ylabel(, labsize(small)) xlabel(, labsize(small)) legend(order(1 "No MH" 2 "Depression/anxiety" 3 "Depression/anxiety & SH/AS" 4 "SH only/AS only" 5 "Depression/anxiety, SH & AS") col(1)) legend(size(small))
1. Is it possible to plot a 'stacked bar chart' using the marginsplot command? I'm unable to find this as an option in Stata. Currently, with the 'recast bar' option, some of the smaller predicted probabilities get hidden or covered by larger probabilities (for e.g., subgraphs B,C & D, the depression/anxiety category is not visible at all, but CIs are. A stacked bar chart would potentially get rid of this issue.
2. Is it possible to change the placement of the 95% CIs (i.e. to have small gaps betwen them) to make it easier to read over lapping CIs?
I've looked online but unable to find any information that addresses the above.
Any help would be really appreciated!
Thanks
/Amal
Bargraph-stataexample.gph