I finally managed to create a clustered stacked bar in stata (after a lot of trial and error). Here’s the code I used and the output:
clear
input time_period scenario s str2 cid 3 1 4.013453 “fw” 4 1 4.064307
“fw” 5 1 4.370211 “fw” 3 1 19.20553 “he” 4 1 22.62123 “he” 5 1
25.16719 “he” 3 2 6.894791 “fw” 4 2 6.960844 “fw” 5 2 9.851804 “fw” 3 2 14.96675 “he” 4 2 18.20208 “he” 5 2 17.93641 “he” end// Display the data list
gr bar (asis) s, over(cid) over(scenario, label(nolabel) gap(0))
over(time_period) stack ytitle(“Total wealth”)
graphregion(color(white)) legend(rows(1) cols(2) order(1 “FW” 2 “HE”)
ring(1) position(6)) b1title(“Period”) bar(1, fcolor(“0 114 189”))
bar(2, fcolor(“217 83 25”)) plotregion(lcolor(black))
Now is there anyway I can make the bars on the left have a different color than the bars on the right? (ideally slightly more transparent)