Mar 18, 2013

Random graphs (9): Bar graphs

clear

// Copy and paste data from here:
// http://epp.eurostat.ec.europa.eu/cache/
// ITY_PUBLIC/3-07032013-AP/EN/3-07032013-AP-EN.PDF

input str30 geo ///
      teachers_primary ///
   teachers_secondary ///
   teachers_tertiary ///
   physicians ///
   managers
EU27 85 59 40 45 33
Belgium 81 61 45 36 30
Bulgaria 94 78 48 . 37
"Czech Republic" 97 58 36 54 26
Denmark 69 . . 45 28
Germany 84 50 39 42 30
Estonia 93 73 . 74 36
Ireland 85 65 . 39 34
Greece . . . 39 23
Spain 75 50 40 51 30
France 83 54 36 41 40
Italy 96 63 36 37 25
Cyprus 83 59 39 . 15
Latvia 93 80 59 74 45
Lithuania 96 79 55 70 39
Luxembourg 74 50 43 30 25
Hungary 96 65 38 54 41
Malta 85 43 30 37 24
Netherlands 85 50 40 45 30
Austria 90 53 38 44 27
Poland 85 66 43 57 39
Portugal 80 68 44 51 34
Romania 86 67 46 69 31
Slovenia 97 66 39 59 38
Slovakia 89 71 44 56 31
Finland 79 58 50 55 32
Sweden 82 52 43 45 35
"United Kingdom" 87 60 43 45 35
Iceland 81 52 47 33 41
Liechtenstein 78 44 27 . .
Norway 74 50 43 43 32
Switzerland 81 40 37 36 33
end

// Label variables
label var geo "Country"
label var teachers_primary "Female teachers in primary education"
label var teachers_secondary "Female teachers in upper secondary education"
label var teachers_tertiary "Female academic staff in tertiary education"
label var physicians "Female physicians (2010)"
label var managers "Female managers"

// Country variable
kountry geo, from(other) stuck
ren _ISO3N_ ctry
kountry ctry, from(iso3n) to(iso2c)
replace _ISO2C_ = "EU-27" if geo == "EU27"
drop ctry
ren _ISO2C_ cntry

drop if cntry == "LI"

// Draw graph
graph hbar managers, over(cntry, sort(1) desc) ///
  xsize(5.5) ysize(8) ///
  caption("Source: Eurostat News Release 37/2013", span) ///
/*note("Includes both corporate managers ///
  and managers of small enterprises", span)*/ ///
  ytitle("Proportion of female managers in 2011")

// Black bar created via the graph editor