I'd like to plot two different graphs using the same data.
(1) yearly data over five waves in a single graph:
Code:
tw (line totasset_ecpc agegrp if wave == 2 & inrange(agegrp, 30, 80)) /// (line totasset_ecpc agegrp if wave == 6 & inrange(agegrp, 30, 80)) /// (line totasset_ecpc agegrp if wave == 10 & inrange(agegrp, 30, 80)) /// (line totasset_ecpc agegrp if wave == 14 & inrange(agegrp, 30, 80)) /// (line totasset_ecpc agegrp if wave == 18 & inrange(agegrp, 30, 80)), /// title("Share of Assets - ECPC") name(ecpc, replace) /// xla(30(10)80) xtitle("age") ytitle(" Proportion") yla(.3(.1).8) /// legend(order(1 "Wave 2" 2 "Wave 6" 3 "Wave 10" 4 "Wave 14" 5 "Wave 18")) /// legend(region(lstyle(none)) size(small) col(3) row(1) pos(6) rowgap(1) span)
Code:
tw (scatter totasset_ecpc agegrp if inrange(agegrp, 30, 80)), title("Share of Assets - ECPC (all waves)") /// xla(30(10)80) xtitle("age") ytitle(" Share of assets") yla(.3(.1).8) name(ecpcall, replace)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte wave float(totasset_ecpc agegrp) 2 .7590239 20 6 . 20 10 .8799195 20 14 .2183252 20 18 . 20 2 .2032862 25 6 .44044 25 10 .4350298 25 14 .4296866 25 18 .8124846 25 2 .5380963 30 6 .3945256 30 10 .4283356 30 14 .5113511 30 18 .3327902 30 2 .5441144 35 6 .4536623 35 10 .4263607 35 14 .397131 35 18 .48152775 35 2 .531788 40 6 .6135195 40 10 .4566517 40 14 .51987433 40 18 .39560035 40 2 .501982 45 6 .50936675 45 10 .5787155 45 14 .53960353 45 18 .4934241 45 2 .5184313 50 6 .4877012 50 10 .51347977 50 14 .542489 50 18 .55537874 50 2 .5851486 55 6 .511164 55 10 .4935571 55 14 .4886676 55 18 .5297553 55 2 .5776826 60 6 .5293519 60 10 .5640008 60 14 .4978073 60 18 .4536004 60 2 .55672157 65 6 .6667274 65 10 .5255127 65 14 .5557258 65 18 .4618697 65 2 .6269194 70 6 .532701 70 10 .5955692 70 14 .5492495 70 18 .55500907 70 2 .505511 75 6 .6363178 75 10 .5910302 75 14 .4802268 75 18 .542687 75 2 .27799776 80 6 .4065089 80 10 .4931756 80 14 .6125295 80 18 .5147132 80 end
0 Response to Options to plot yearly data for five years in a single graph
Post a Comment