Jan 13, 2015

Random graphs (44): Small-multiples line plots

import excel "no of embryos transferred.xlsx", sheet("Tabelle1") firstrow clear

reshape long tot e1a e1p e2a e2p e3a e3p e4a e4p, i(country) j(year)

kountry country, from(other) stuck
ren _ISO3N_ ctry
kountry ctry, from(iso3n) to(iso2c)
drop ctry
ren _ISO2C_ cntry
replace cntry = "UK" if cntry == "GB"

order country cntry year tot e1a e2a e3a e4a e1p e2p e3p e4p
drop if cntry == "CY" | cntry == "EE" | cntry == "NL"
drop if cntry == "AL" | cntry == "BA" | cntry == "HR"
drop if cntry == "KZ" | cntry == "MD" | cntry == "RO"
drop if cntry == "UA" | cntry == "RS" | cntry == "TR"
drop if cntry == "ME" 

twoway (line e1p year, by(cntry, note("")) cmissing(no) lwidth(thick)) ///
       (line e2p e3p e4p year, by(cntry, note("{it:Sources:} ESHRE EIM reports, {it:Human Reproduction} 2001{c 150}2014", span)) cmissing(no)) ///
       , xlabel(1997 2000 2005 2010, ang(h)) xtitle("") ytitle("% of all transfers") ///
  legend(label(1 "1 embryo")  label(2 "2 embryos") ///
         label(3 "3 embryos") label(4 "4+ embryos") row(1))