Hello All,
I am trying to assess if the income inequality of few developing countries is improving or worsening by taking a data of 2005 and 2023. In my same, I have 9 from SSA countries and 14 from other developing countries. How can I assign different bar colors in a bar graph based on a dummy variable (1 = African country, 0 = non-African),
I run the following code:
sort id year
**change in inequality from 2005- 2023
by id: gen ineq = gini - gini[_n-18]
graph bar ineq, over(id, sort(1) lab(angle(45)) ) graphregion(color(white)) scheme(s2color) ytitle("change in inequality")
I tried to run the following code but didn't work
graph bar ineq if africa_dummy == 1, over(id, sort(1) lab(angle(45))) bar(1, color(green)) ///
name(africa, replace) ///
addplot(graph bar ineq if africa_dummy == 0, over(id, sort(1) lab(angle(45))) bar(1, color(blue))) ///
legend(off)
Any suggestion, Thanks
I am trying to assess if the income inequality of few developing countries is improving or worsening by taking a data of 2005 and 2023. In my same, I have 9 from SSA countries and 14 from other developing countries. How can I assign different bar colors in a bar graph based on a dummy variable (1 = African country, 0 = non-African),
I run the following code:
sort id year
**change in inequality from 2005- 2023
by id: gen ineq = gini - gini[_n-18]
graph bar ineq, over(id, sort(1) lab(angle(45)) ) graphregion(color(white)) scheme(s2color) ytitle("change in inequality")
I tried to run the following code but didn't work
graph bar ineq if africa_dummy == 1, over(id, sort(1) lab(angle(45))) bar(1, color(green)) ///
name(africa, replace) ///
addplot(graph bar ineq if africa_dummy == 0, over(id, sort(1) lab(angle(45))) bar(1, color(blue))) ///
legend(off)
Any suggestion, Thanks
Comment