Hi all,
I'm using data for the past 30 years on the unemployment rate, industrial production growth, trade-weighted dollar index, a commodity spot index by the CRB and inflation expectations. I'm using an ordered probit model to forecast the probability that the the CPI will be in a high inflation environment (>2.5%), medium inflation environment (1.5%<inflation<=2.5%), or low inflation environment (<=1.5%) coded as 2, 1, or 0, respectively based on the five factors above. I'm also using the ordered probit model to do the same for each of the 8 product categories in the CPI (but I'm only using 6 of them because of data reasons). I used the following code to get the marginal effects on the categories, but I'm having trouble with the combomarginsplot. The bars are are stacked on top of each other, but ideally, I would like each product category to be its own bar. So there would be a cluster of 6 bars side-by-side for each of the factors, so 18 bars total in all. And I would have 3 graphs total (for each of the inflation environments). Any ideas how to do that? Note, the code below is only for the low inflation environment, so I still need two more graphs.
Thanks!
I'm using data for the past 30 years on the unemployment rate, industrial production growth, trade-weighted dollar index, a commodity spot index by the CRB and inflation expectations. I'm using an ordered probit model to forecast the probability that the the CPI will be in a high inflation environment (>2.5%), medium inflation environment (1.5%<inflation<=2.5%), or low inflation environment (<=1.5%) coded as 2, 1, or 0, respectively based on the five factors above. I'm also using the ordered probit model to do the same for each of the 8 product categories in the CPI (but I'm only using 6 of them because of data reasons). I used the following code to get the marginal effects on the categories, but I'm having trouble with the combomarginsplot. The bars are are stacked on top of each other, but ideally, I would like each product category to be its own bar. So there would be a cluster of 6 bars side-by-side for each of the factors, so 18 bars total in all. And I would have 3 graphs total (for each of the inflation environments). Any ideas how to do that? Note, the code below is only for the low inflation environment, so I still need two more graphs.
Code:
quietly oprob inflcateg UNRATE outputgrowth MICH dollgrowth commgrowth margins, dydx(UNRATE outputgrowth commgrowth dollgrowth MICH) predict(outcome(0)) saving(f1, replace) quietly oprob inflcategogsns UNRATE outputgrowth MICH dollgrowth commgrowth margins, dydx(UNRATE outputgrowth commgrowth dollgrowth MICH) predict(outcome(0)) saving(f2, replace) quietly oprob inflcategtrnns UNRATE outputgrowth MICH dollgrowth commgrowth margins, dydx(UNRATE outputgrowth commgrowth dollgrowth MICH) predict(outcome(0)) saving(f3, replace) quietly oprob inflcateghosns UNRATE outputgrowth MICH dollgrowth commgrowth margins, dydx(UNRATE outputgrowth commgrowth dollgrowth MICH) predict(outcome(0)) saving(f4, replace) quietly oprob inflcategfabns UNRATE outputgrowth MICH dollgrowth commgrowth margins, dydx(UNRATE outputgrowth commgrowth dollgrowth MICH) predict(outcome(0)) saving(f5, replace) quietly oprob inflcategappns UNRATE outputgrowth MICH dollgrowth commgrowth margins, dydx(UNRATE outputgrowth commgrowth dollgrowth MICH) predict(outcome(0)) saving(f6, replace) marginsplot, recast(bar) title("Marginal Effects of Drivers on a Low Inflation Environment") xtitle("Drivers") ytitle("Marginal Effects") combomarginsplot f1 f2 f3 f4 f5 f6, plotdim(_filenumber) recast(bar) /// title("Marginal Effects of Drivers on a Low Inflation Environment") xtitle("Drivers") ytitle("Marginal Effects") label("Aggregate Inflation" "Other Goods and Services" "Transportation" "Housing" "Food and Beverages" "Apparel") ///