Hi,
I am trying to figure out whether it is possible to reflect the weights of the categories of a categorical variable in a stacked graph bar in the x-axis. On the x-axis, the variable is categorised in 10 units intervals (hours). The y-axis compares overtime and hours in 2nd job against the basic hours (x-axis). The code I used to plot the graph is attached.
graph bar (mean) avg_overtimehrs ///
(mean) avg_2ndjobhrs, ///
over(basichrs_10bin, label(angle(vertical) labsize(small))) ///
stack ytitle(Avg. Overtime & hours 2nd job) ///
ytitle(, size(small) margin(medsmall)) ///
ylabel(0(5)32, labsize(small) angle(horizontal) valuelabel) ///
ymtick(0(1)32, labsize(small)) ///
legend(order(1 "Overtime hours" 2 "2nd job hours") ///
rows(2) size(medsmall) color(black) nobox region(fcolor(none) lcolor(none))) ///
scheme(s1mono) ///
graphregion(fcolor(none) lcolor(none) ifcolor(none) ilcolor(none)) ///
plotregion(fcolor(none) lcolor(black) ifcolor(none) ilcolor(none))
Thanks
Alberto
I am trying to figure out whether it is possible to reflect the weights of the categories of a categorical variable in a stacked graph bar in the x-axis. On the x-axis, the variable is categorised in 10 units intervals (hours). The y-axis compares overtime and hours in 2nd job against the basic hours (x-axis). The code I used to plot the graph is attached.
graph bar (mean) avg_overtimehrs ///
(mean) avg_2ndjobhrs, ///
over(basichrs_10bin, label(angle(vertical) labsize(small))) ///
stack ytitle(Avg. Overtime & hours 2nd job) ///
ytitle(, size(small) margin(medsmall)) ///
ylabel(0(5)32, labsize(small) angle(horizontal) valuelabel) ///
ymtick(0(1)32, labsize(small)) ///
legend(order(1 "Overtime hours" 2 "2nd job hours") ///
rows(2) size(medsmall) color(black) nobox region(fcolor(none) lcolor(none))) ///
scheme(s1mono) ///
graphregion(fcolor(none) lcolor(none) ifcolor(none) ilcolor(none)) ///
plotregion(fcolor(none) lcolor(black) ifcolor(none) ilcolor(none))
Thanks
Alberto
Comment