Sep 20, 2017

Random graphs (113): Cumulative line plot

clear
input year yes no
2000 3 4
2001 0 0
2002 0 0
2003 0 0
2004 0 0
2005 1 0
2006 0 0
2007 1 1
2008 0 1
2009 1 0
2010 0 1
2011 3 0
2012 1 1
2013 1 1
2014 1 2
2015 4 0
2016 8 2
2017 2 1
end

sort year
gen yes_cum = sum(yes)
gen no_cum = sum(no)

label define year 2000 `""2000" "and before""'
label val year year

twoway line yes_cum year || line no_cum year || ///
       scatteri 15 2017 "No grandparent effect found", msymbol(i) mlabpos(8) || ///
       scatteri 27 2017 "Grandparent effect found", msymbol(i) mlabpos(8) ||, ///
       xtitle("") xlabel(2000 (5) 2015 2017, val) ///
       ytitle("Number of studies published") ///
       legend(off)