I want to show over the years the total number of states took these policies in. a stacked bar graph.
Code:
gen min_wage=0 replace min_wage = 1 if year>=2015 & (statefip==2 /*alaska*/) replace min_wage = 1 if year>=2015 & (statefip==5 /*Arkansas*/) replace min_wage = 1 if year>=2013 & (statefip==4 /*Arizona*/) replace min_wage = 1 if year>=2015 & (statefip==6 /*California*/) replace min_wage = 1 if year>=2015 & (statefip==9 /*Connecticut*/) replace min_wage = 1 if year==2015 & (statefip==8 /*Colorado*/) replace min_wage = 1 if year>=2014 & (statefip==11 /*Dis.of Col*/) gen min_wagead=0 replace min_wagead = 1 if year>=2018 & (statefip==32) replace min_wagead = 1 if year>=2017 & (statefip==35) replace min_wagead = 1 if year>=2017 & (statefip==34 ) replace min_wagead = 1 if year>=2015 & (statefip==36 ) replace min_wagead = 1 if year>=2018 & (statefip==39 ) replace min_wagead = 1 if year==2019 & (statefip==48) replace min_wagead = 1 if year>=2019 & (statefip==51)
Code:
graph bar statefip if min_wage==`1' & min_wagead==`1', over(year) bar(1, color(usaid_red) lcolor(black)) bar(2, color(usaid_darkgray) lcolor(black)) /// blabel(total, position(inside) format(%2.0f) color(white) /*size(5)*/) stack /// title("# of states using minimum wage") /// note("Source: Minimum wage) /// legend(label(1 "# Minimum wage initial") label(2 "# Minimum wage later")) graphregion(color(white))
0 Response to Stacked bar graph for multiple policies for states across years
Post a Comment