
import delimited C:\internet\isoc_bdek_di_1_Data.csv, clear
// Generate country variable
kountryadd "Germany (until 1990 former territory of the FRG)" to "Germany" add
kountry geo, from(other) stuck marker
ren _ISO3N_ country
kountry country, from(iso3n) to(iso2c)
ren _ISO2C_ country_str
replace country_str = "UK" if country_str == "GB"
replace country_str = "EU25" if geo == "European Union (25 countries)"
replace country_str = "EU27" if geo == "European Union (27 countries)"
replace country_str = "EU28" if geo == "European Union (28 countries)"
replace country_str = "EU15" if geo == "European Union (15 countries)"
drop if geo == "Euro area (EA11-2000, EA12-2006, EA13-2007, EA15-2008, EA16-2010, EA17-2013, EA18-2014, EA19)"
drop MARKER country
*list country_str geo
// Fix variables
drop ind_type // Drop constant
replace value = "" if value == ":" // Fix missing data indicator
destring value, replace // Convert to numeric
encode indic_is, gen(indic) // Convert from string
label var time "Time"
// Keep relevant cases
keep if unit == "Percentage of individuals"
drop if inlist(country_str, "CH", "EU25", "EU28", "ME", "RS")
twoway (line value time if indic == 1, by(country_str, note("{it:Source:} Eurostat, isoc_bdek_di", span))), ///
ytitle("% who access internet at least once a week") ///
xlabel(2003 2005 2010 2015, ang(h) alternate) xtitle("") ///
name(graph1, replace)

// All in one plot
encode country_str, gen(country)
keep if indic == 1
xtset country time, yearly
keep if inlist(country, 6, 7, 8, 10, 16, 19, 25, 29, 30, 34) // Reduce number of countries
xtline value, overlay xlabel(2003 2005 2010 2015, ang(h)) xtitle("") ///
ytitle("% who access internet at least once a week") ///
legend(pos(2)) name(graph2, replace) ///
note("{it:Source:} Eurostat, isoc_bdek_di", span)xlabel(2003 2005 2010 2015, ang(h) alternate) xtitle("") ///
name(graph2, replace)