// Use OECD data
sdmxuse data OECD, dataset(IDD) clear attributes
// Generate country variable
kountry location, from(iso3c)
rename NAMES_STD country
// Generate year variable
destring time, gen(year)
// Keep relevant data
keep if measure == "GINI"
keep if age == "TOT"
keep if definition == "CURRENT"
keep if inlist(country, "Netherlands", "Germany", "United Kingdom", "United States")
drop if methodo == "METH2012"
sort country year
twoway (connected value year if country == "Germany") ///
(line value year if country == "Netherlands", lcolor(gs10) lpattern(solid)) ///
(line value year if country == "United Kingdom", lcolor(gs10) lpattern(solid)) ///
(line value year if country == "United States", lcolor(gs10) lpattern(solid)) ///
, legend(off) name(pa, replace) title(Germany) xtitle("") ytitle("Income inequality") ///
ylabel(, format(%6.2f))
twoway (connected value year if country == "Netherlands") ///
(line value year if country == "Germany", lcolor(gs10) lpattern(solid)) ///
(line value year if country == "United Kingdom", lcolor(gs10) lpattern(solid)) ///
(line value year if country == "United States", lcolor(gs10) lpattern(solid)) ///
, legend(off) name(pb, replace) title(Netherlands) xtitle("") ytitle("Income inequality") ///
ylabel(, format(%6.2f))
twoway (connected value year if country == "United Kingdom") ///
(line value year if country == "Germany", lcolor(gs10) lpattern(solid)) ///
(line value year if country == "Netherlands", lcolor(gs10) lpattern(solid)) ///
(line value year if country == "United States", lcolor(gs10) lpattern(solid)) ///
, legend(off) name(pc, replace) title(United Kingdom) xtitle("") ytitle("Income inequality") ///
ylabel(, format(%6.2f))
twoway (connected value year if country == "United States") ///
(line value year if country == "Germany", lcolor(gs10) lpattern(solid)) ///
(line value year if country == "Netherlands", lcolor(gs10) lpattern(solid)) ///
(line value year if country == "United Kingdom", lcolor(gs10) lpattern(solid)) ///
, legend(off) name(pd, replace) title(United States) xtitle("") ytitle("Income inequality") ///
ylabel(, format(%6.2f))
graph combine pa pb pc pd, col(2) name(fig1, replace)
Dec 2, 2017
Random graphs (120): Uncluttered line plots
Labels:
kountry,
OECD data,
Random graphs,
sdmxuse,
twoway connected,
twoway line
