Oct 18, 2013

Random graphs (17): Differences in percentages across groups

clear

// Read in data

/// Employment (main characteristics and rates) - annual averages [lfsi_emp_a]
/// Last update: 10-07-2013 
/// Employment rate (20 to 64 years) 

input str33 geo total male female
"European Union (28 countries)" 68.4 74.5 62.3
"European Union (27 countries)" 68.5 74.6 62.4
"Belgium" 67.2 72.7 61.7
"Bulgaria" 63.0 65.8 60.2
"Czech Republic" 71.5 80.2 62.5
"Denmark" 75.4 78.6 72.2
"Germany" 76.7 81.8 71.5
"Estonia" 72.1 75.2 69.3
"Ireland" 63.7 68.1 59.4
"Greece" 55.3 65.3 45.2
"Spain" 59.3 64.5 54.0
"France" 69.3 73.8 65.0
"Croatia" 55.4 60.6 50.2
"Italy" 61.0 71.6 50.5
"Cyprus" 70.2 76.1 64.8
"Latvia" 68.2 70.2 66.4
"Lithuania" 68.7 69.4 67.9
"Luxembourg" 71.4 78.5 64.1
"Hungary" 62.1 68.1 56.4
"Malta" 63.1 79.0 46.8
"Netherlands" 77.2 82.5 71.9
"Austria" 75.6 80.9 70.3
"Poland" 64.7 72.0 57.5
"Portugal" 66.5 69.9 63.1
"Romania" 63.8 71.4 56.3
"Slovenia" 68.3 71.8 64.6
"Slovakia" 65.1 72.8 57.3
"Finland" 74.0 75.5 72.5
"Sweden" 79.4 81.9 76.8
"United Kingdom" 74.2 80.0 68.4
"Iceland" 81.8 84.4 79.1
"Norway" 79.9 82.4 77.3
"Switzerland" 82.0 87.9 76.0
end

/// Create country variable
kountry geo, from(other) stuck
ren _ISO3N_ ctry
kountry ctry, from(iso3n) to(iso2c)
replace _ISO2C_ = "EU-27" if geo == "European Union (27 countries)"
replace _ISO2C_ = "EU-28" if geo == "European Union (28 countries)"
replace _ISO2C_ = "GB" if geo == "United Kingdom"
replace _ISO2C_ = "EL" if geo == "Greece"
drop ctry
ren _ISO2C_ cntry

drop if inlist(cntry, "EU-28", "IS", "CH", "NO")

graph dot male female, over(cntry, sort(total) ///
      label(angle(v))) vertical exclude0 ///
   legend(label(1 "Males") label(2 "Females") ring(0)) ///
   ytitle("Employment rate among 20-64 year-olds," "2012") ///
   yline(75) text(76 12 "Europe 2020 target") ///
   note( ///
          "{it:Source:} Eurostat, lfsi_emp_a, date of extraction: 2013-08-04" ///
          "{it:Note:} Countries sorted by total employment rates", span)