-
Login or Register
- Log in with
webuse grunfeld, clear fabplot line invest year, by(company) ysc(log) yla(1 10 100 1000)
... if company <= 4
fabplot line invest year, by(company) ysc(log) yla(1 10 100 1000) select(company <= 4) xla(, format(%tyYY)) xtitle("") frontopts(lw(thick))
set scheme s1color
sysuse auto, clear
fabplot scatter mpg weight, by(rep78) name(G1, replace)
more
fabplot scatter mpg weight, frontopts(ms(none) mla(rep78) mlabsize(*1.5) mlabpos(0) mlabcolor(blue)) by(rep78) name(G2, replace)
more
webuse grunfeld
fabplot line invest year, by(company) xtitle("") ysc(log) yla(1 10 100 1000) name(G3, replace)
more
fabplot line invest year, by(company) xtitle("") ysc(log) yla(1 10 100 1000) front(connect) frontopts(mc(blue) lc(blue)) name(G4, replace)
clear
input int year double(de fr be nl den ch aut cz pl)
1927 10.9 16.5 13 10.2 11.6 12.4 15 16 17.3
1928 11.2 16.4 12.8 9.6 11 12 14.5 15.1 16.4
1929 11.4 17.9 14.4 10.7 11.2 12.5 14.6 15.5 16.7
1930 10.4 15.6 12.8 9.1 10.8 11.6 13.5 14.2 15.6
1931 10.4 16.2 12.7 9.6 11.4 12.1 14 14.4 15.5
1932 10.2 15.8 12.7 9 11 12.2 13.9 14.1 15
1933 10.8 15.8 12.7 8.8 10.6 11.4 13.2 13.7 14.2
1934 10.6 15.1 11.7 8.4 10.4 11.3 12.7 13.2 14.4
1935 11.4 15.7 12.3 8.7 11.1 12.1 13.7 13.5 14
1936 11.7 15.3 12.2 8.7 11 11.4 13.2 13.3 14.2
1937 11.5 15 12.5 8.8 10.8 11.3 13.3 13.3 14
end
rename (de-pl) (death=)
reshape long death, i(year) j(country) string
egen where = group(country), label
gen long id = _n
expand 9
bysort id : gen group = _n
label val group where
separate death, by(group == where)
local note "countries highlighted in turn"
set scheme s1color
sort group country year
twoway line death0 year, lc(gs12) by(group, compact note("`note'") legend(off)) ///
subtitle(, fcolor(ltblue*0.5)) c(L) xtitle("") ///
ytitle("death rate, yearly deaths per 1000") yla(8(2)18, ang(h)) xla(1927(5)1937, format(%tyY)) ///
|| connected death1 year, lc(blue) mc(blue) ms(oh)
sysuse lifeexp.dta, clear scatter lexp gnppc , mla(country)
Leave a comment: