clear
input str5 cntry eqls2003 eqls2007 ewcs2005 ewcs2010 eusilc2014
SE 0.021949 0.030043 0.00213 0.000918 .
FI 0.022075 0.013452 0.02246 0.011247 0.00012
HR . 0.018228 0.017975 0.013302 .
SK 0.011168 0.035384 0.013425 0.019773 0.003893
CZ 0.005486 0.064484 0.008917 0.005968 0.000863
NO . 0.0226 0.021383 0.018745 0.012686
CH . . 0.028731 . .
HU 0.018815 0.060927 0.044574 0.013885 0.019517
SI 0.025373 0.030885 0.095199 0.019257 0.001327
NL 0.035021 0.048701 0.021501 0.034217 .
BE 0.039831 0.088688 0.025436 0.006923 0.01386
EE 0.027082 0.048187 0.052969 0.052337 0.006435
FR 0.030219 0.074314 0.040906 0.01435 .
LT 0.049985 0.077502 0.05434 0.032847 0.006778
BG 0.037858 0.063697 0.065784 0.032313 0.039127
PL 0.023636 0.075742 0.06099 0.037228 .
LU 0.106816 0.102864 0.004992 0.006159 0.032854
DE 0.090262 0.040957 0.038157 0.035452 .
RO 0.063563 0.072842 0.070762 0.022769 .
LV 0.09474 0.077167 0.054927 0.034465 0.038258
IT 0.040173 0.128064 0.06421 0.036467 .
AT 0.057465 0.132496 0.095462 0.05458 .
ES 0.112064 0.127856 0.086716 0.076224 0.038867
DK 0.129036 0.103272 0.107504 0.040896 .
UK 0.120762 0.124342 0.150114 0.083238 0.024998
ME . . . 0.101533 .
PT 0.173582 0.179532 0.073722 0.113514 0.091105
RS-KM . . . 0.160115 .
MK . 0.194579 . 0.128292 .
IE 0.270422 0.359196 0.293468 0.240577 0.03082
AL . . . 0.275311 .
GR 0.404795 0.53023 0.286437 0.292037 0.144072
MT 0.302118 0.465496 0.387637 0.277371 .
CY 0.322423 0.54425 0.436497 0.395157 .
TR 0.564689 0.496668 0.689807 0.643683 .
end
scores average = mean(eqls2003 eqls2007 ewcs2005 ewcs2010)
kountry cntry, from(iso2c) marker
rename NAMES_STD country
replace country = "Kosovo" if country == "rskm"
egen order_ = rank(average), unique
labmask order_, value(country)
twoway (dot eqls2003 order_, horizontal) ///
(dot eqls2007 order_, horizontal) ///
(dot ewcs2005 order_, horizontal) ///
(dot ewcs2010 order_, horizontal) ///
(dot eusilc2014 order_, horizontal) ///
, ylabel(1/35, val) ysize(9) ///
ytitle("") xscale(alt) ///
xtitle("Proportion without job contract") ///
legend(order(1 "EQLS 2003" ///
2 "EQLS 2003" ///
3 "EWCS 2005" ///
4 "EWCS 2010" ///
5 "EU-SILC 2014") title("Data source") pos(5) ring(0))
Showing posts with label EU Survey of Income and Living Conditions. Show all posts
Showing posts with label EU Survey of Income and Living Conditions. Show all posts
Nov 16, 2017
Random graphs (118): Dot plot
Feb 25, 2016
Random graphs (61): Dot plot for two groups
tempname foo
tempname foox
postfile `foo' str2 cntry perc_f perc_f_ll perc_f_ul ///
perc_m perc_m_ll perc_m_ul using `foox' , replace
levelsof cntry, local(levels1)
// Calculate proportions by country
foreach country of local levels1 {
capture proportion nonesep_f if cntry == "`country'"
*matrix list r(table)
matrix fcoefs = r(table)
local fperc = fcoefs[1,2] * 100
local fperc_ll = fcoefs[5,2] * 100
local fperc_ul = fcoefs[6,2] * 100
capture proportion nonesep_m if cntry == "`country'"
*matrix list r(table)
matrix mcoefs = r(table)
local mperc = mcoefs[1,2] * 100
local mperc_ll = mcoefs[5,2] * 100
local mperc_ul = mcoefs[6,2] * 100
di "`country'" _skip(2) `fperc_ll' _skip(2) `fperc' _skip(2) `fperc_ul'
di "`country'" _skip(2) `mperc_ll' _skip(2) `mperc' _skip(2) `mperc_ul'
if "`fperc'" != "" { // Make sure that the loop doesn't break if empty
post `foo' ("`country'") (`fperc') (`fperc_ll') (`fperc_ul') (`mperc') (`mperc_ll') (`mperc_ul')
}
}
postclose `foo'
// Use posted data set
use `foox', clear
// Reverse sign of one variable
replace perc_m = -perc_m
replace perc_m_ll = -perc_m_ll
replace perc_m_ul = -perc_m_ul
// Sort countries by size
egen order_ = rank(-perc_f), unique
labmask order_, value(cntry)
// Plot
twoway (dot perc_m order_, horizontal) ///
(dot perc_f order_, horizontal) ///
, ylabel(1/31, val) legend(order(1 "Men" 2 "Women") pos(6) row(1)) ///
ytitle("") xtitle("% of men/women pooling all income") ///
xline(0) ///
xlabel(-100 "100" -50 "50" 0 "0" 50 "50" 100 "100") ///
name(somefigure, replace) ysize(8)
Subscribe to:
Posts (Atom)

