Showing posts with label cmissing(no). Show all posts
Showing posts with label cmissing(no). Show all posts

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)) 

Nov 7, 2014

Random graphs (36): Small-multiples line plot

clear
input str2 cntry r1998 r2001 r2004 r2007 r2010 r2013
AT 6 6 6 6 6 3
BE 6 6 2 3 6 6
BG . . 4 6 6 3
CA 6 6 6 6 . .
CH . 4 3 6 3 3
CZ 4 4 6 3 . 6
DE 3 3 3 3 3 .
DK 3 3 3 3 2 3
GR 6 6 6 4 4 .
ES 6 6 6 3 3 3
FI 6 6 6 6 . 6
FR 6 6 6 . . 3
HR . . . 3 3 .
HU 4 4 4 4 4 4
IE 6 3 6 6 . 6
IL 6 4 6 6 6 1
IS . . . . 2 6
IT 4 4 6 3 . 6
JP 4 4 3 . 1 2
LV . . . 3 3 3
NL 6 6 6 6 2 .
NO 6 6 6 3 . 6
PL 3 3 3 . 6 .
PT 6 3 4 6 . .
RO . . 6 6 3 .
SE 3 3 2 2 2 2
SI . . 3 3 3 3
TR 6 6 6 6 3 2
UK 2 2 3 2 3 2
US 6 5 6 5 . 6
end

reshape long r, i(cntry) j(year)

label define r 6 "No limit"
label val r r

twoway (connected r year, by(cntry, note("")) /// // by(, note("")) suppresses
                          ylabel(0(1)6, val) ///  // "Graphs by"
                          xlabel(1998 2001 2004 2007 2010 2013) ///                          
                          lwidth(thick) cmissing(no) msize(large) msymbol(O) ///
                          xtitle("") ytitle("Maximum number of embryos per cycle"))