-
Login or Register
- Log in with
clear input int Year str3 Month int(stack_var_1 stack_var_2 stack_total_labels) long second_y double(stack_var_2_labels stack_var_1_labels) 2022 "Jan" 1407 508 1915 1915 .27 .73 2022 "Feb" 10048 3491 13539 15454 .26 .74 2022 "Mar" 13310 5898 19208 34662 .31 .69 2022 "Apr" 6339 5394 11733 46395 .46 .54 2022 "May" 6583 5949 12532 58927 .47 .53 2022 "Jun" 8460 6291 14751 73678 .43 .57 2022 "Jul" 3534 4287 7821 81499 .55 .45 2022 "Aug" 3730 6850 10580 92079 .65 .35 2022 "Sep" 2351 6106 8457 100536 .72 .28 2022 "Oct" 2370 7440 9810 110346 .76 .24 2022 "Nov" 2013 6763 8776 119122 .77 .23 2022 "Dec" 2138 7125 9263 128385 .77 .23 2023 "Jan" 2257 6709 8966 137351 .75 .25 2023 "Feb" 1728 6365 8093 145444 .79 .21 2023 "Mar" 1698 5905 7603 153047 .78 .22 2023 "Apr" 1204 4185 5389 158436 .78 .22 end
clear input int Year str3 Month int(stack_var_1 stack_var_2 stack_total_labels) long second_y double(stack_var_2_labels stack_var_1_labels) 2022 "Jan" 1407 508 1915 1915 .27 .73 2022 "Feb" 10048 3491 13539 15454 .26 .74 2022 "Mar" 13310 5898 19208 34662 .31 .69 2022 "Apr" 6339 5394 11733 46395 .46 .54 2022 "May" 6583 5949 12532 58927 .47 .53 2022 "Jun" 8460 6291 14751 73678 .43 .57 2022 "Jul" 3534 4287 7821 81499 .55 .45 2022 "Aug" 3730 6850 10580 92079 .65 .35 2022 "Sep" 2351 6106 8457 100536 .72 .28 2022 "Oct" 2370 7440 9810 110346 .76 .24 2022 "Nov" 2013 6763 8776 119122 .77 .23 2022 "Dec" 2138 7125 9263 128385 .77 .23 2023 "Jan" 2257 6709 8966 137351 .75 .25 2023 "Feb" 1728 6365 8093 145444 .79 .21 2023 "Mar" 1698 5905 7603 153047 .78 .22 2023 "Apr" 1204 4185 5389 158436 .78 .22 end gen mdate = monthly(Month + " " + strofreal(Year), "MY") format mdate %tm_Mon_YY twoway bar stack_var_1 mdate, xtitle("") || rbar stack_var_1 stack_total_labels mdate /// || line second_y mdate, legend(order(3 "cumulative" 2 "2" 1 "1") col(1) ring(0) pos(3)) /// name(G1, replace) twoway bar stack_var_1 mdate, xtitle("") || rbar stack_var_1 stack_total_labels mdate /// , legend(order(2 "2" 1 "1") col(1) ring(0) pos(1)) ytitle(1 and 2) /// name(G2, replace) xscale(off) line second_y mdate, ytitle("cumulative") xtitle("") name(G3, replace) graph combine G2 G3, xcommon col(1) imargin(small)
Comment