Hello stata-Community,
I run an RIF Oaxaca Blinder decomposition at deciles. I would now like to create a graph to visualize the explained and unexplained part of my two explainatory variables.
I manage to do it for a singe decile, but I don't manage to combine all deciles in one graph.
This is my code for the first decile with stata example data.
Can someone help me?
I run an RIF Oaxaca Blinder decomposition at deciles. I would now like to create a graph to visualize the explained and unexplained part of my two explainatory variables.
I manage to do it for a singe decile, but I don't manage to combine all deciles in one graph.
This is my code for the first decile with stata example data.
Can someone help me?
Code:
*Example data sysuse nlsw88 *make race a binal variable drop if race ==3 *CALCULATE RIF-variables *create deciles and get decile values xtile decile = wage, nq(10) pctile P10 = wage, nquantiles(10) tab decile list P10 if P10 !=., noobs *generate quantil variables forvalues d = 1/9 { gen DEC`d'0 = 0 replace DEC`d'0 = 1 if decile <= `d' } *generate RIF-variables forvalues d = 1/9 { egen rif_`d'0 = rifvar(wage), q(`d'0) kernel(gaussian) } oaxaca rif_10 married grade south occupation , by(race) detail weight(1) mat list e(b) coefplot (., keep(explained: married south )), bylabel("Explained") || /// (., keep(unexplained:*)), bylabel("Unexplained") || , /// drop(*: grade occupation _cons) recast(bar) barwidth(0.5) citop ciopts(recast(rcap) color(black)) /// byopts(cols(1)) xline(0, lpattern(dash)) xlabel(, grid glstyle(minor_grid) glpattern(dash))
Comment