Mar 11, 2016

Random graphs (63): Area plots

generate home = .
replace  home = 1 if homewk == 1 | homewk == 2
replace  home = 0 if homewk == 3

generate usually = .
replace  usually = 1 if homewk == 1
replace  usually = 0 if homewk == 2 | homewk == 3

generate sometimes = .
replace  sometimes = 1 if homewk == 2
replace  sometimes = 0 if homewk == 1 | homewk == 3

collapse (mean) home usually sometimes, by(country refyear)

replace home = home * 100
replace usually = usually * 100
replace sometimes = sometimes * 100

drop if country == 14 & refyear < 2006  

replace sometimes = sometimes + usually

twoway (area sometimes refyear, by(country, note("{it:Source:} EU Labor Force Survey 1998{c 150}2013, HR 2004/5 removed", span))) ///
       (area usually refyear, by(country)), ///
        ytitle("% of labor force working from home") ///
        xlabel(1998 2000 2005 2010 2013, ang(h) alternate) xtitle("") ///
        legend(order(2 "% usually" 1 "% sometimes") row(1) pos(9)) ///
        name(graph, replace)