global program "EEREV-D-21-00004_FigureB7"

cap log close
cap log using "$log\log_$program$today", replace

**** REPLICATION OF FIGURE B7 ****

clear all
set mem 2g
set more off

/*	
	OUTLINE
	1. GRAPH
*/

********************
***** 1. GRAPH *****
********************

// Import birth data

use $data\EEREV-D-21-00004_Data_Births.dta, clear

// Self

twoway ///
	(line p_g0_1914_1927 birthyr if birthyr<2001, lcolor(navy) lpattern(dash)) ///
	(line p_g0_1908_1927 birthyr if birthyr<2001, lcolor(maroon)), ///
	title("Eligibility (Male)", ring(0)) ///, ring(0)
	ytitle("Likelihood", margin(small)) ///
	xtitle("Year of birth", margin(medium)) ///
	ylabel(0(.5)1, angle(0) format(%5.1f)) yscale(r(-.1 1.1)) ///
	xlabel(1900(25)2000) xscale(r(1900 2000)) ///
	legend(label(1 "Moselle") label(2 "Alsace") order(1 2) pos(5) ring(0) cols(1) symx(*0.5) region(col(white))) graphregion(color(white)) /// pos(2) ring(0) 
	xline(1908 1914 1927, lpatter(dash) lcolor(gs12))
graph export "$results\EEREV-D-21-00004_FigureB7_m0.png", replace width(4200) height(3000)

// Husband

twoway ///
	(line p_g0_s_1914_1927 birthyr if birthyr<2001, lcolor(navy) lpattern(dash)) ///
	(line p_g0_s_1908_1927 birthyr if birthyr<2001, lcolor(maroon)), ///
	title("Eligibility (Husband)", ring(0)) ///, ring(0)
	ytitle("Likelihood", margin(small)) ///
	xtitle("Year of birth", margin(medium)) ///
	ylabel(0(.5)1, angle(0) format(%5.1f)) yscale(r(-.1 1.1)) ///
	xlabel(1900(25)2000) xscale(r(1900 2000)) ///
	legend(label(1 "Moselle") label(2 "Alsace") order(1 2) pos(5) ring(0) cols(1) symx(*0.5) region(col(white))) graphregion(color(white)) /// pos(2) ring(0) 
	xline(1908 1914 1927, lpatter(dash) lcolor(gs12))
graph export "$results\EEREV-D-21-00004_FigureB7_s0.png", replace width(4200) height(3000)

// Father

twoway ///
	(line p_g1_1914_1927 birthyr if birthyr<2001, lcolor(navy) lpattern(dash)) ///
	(line p_g1_1908_1927 birthyr if birthyr<2001, lcolor(maroon)), ///
	title("Eligibility (Father)", ring(0)) ///, ring(0)
	ytitle("Likelihood", margin(small)) ///
	xtitle("Year of birth", margin(medium)) ///
	ylabel(0(.5)1, angle(0) format(%5.1f)) yscale(r(-.1 1.1)) ///
	xlabel(1900(25)2000) xscale(r(1900 2000)) ///
	legend(label(1 "Moselle") label(2 "Alsace") order(1 2) pos(5) ring(0) cols(1) symx(*0.5) region(col(white))) graphregion(color(white)) /// 
	xline(1908 1914 1927, lpatter(dash) lcolor(gs12))
graph export "$results\EEREV-D-21-00004_FigureB7_m1.png", replace width(4200) height(3000)

// Grandfather

twoway ///
	(line p_g2_1914_1927 birthyr if birthyr<2001, lcolor(navy) lpattern(dash)) ///
	(line p_g2_1908_1927 birthyr if birthyr<2001, lcolor(maroon)), ///
	title("Eligibility (Grandfather)", ring(0)) ///, ring(0)
	ytitle("Likelihood", margin(small)) ///
	xtitle("Year of birth", margin(medium)) ///
	ylabel(0(.5)1, angle(0) format(%5.1f)) yscale(r(-.1 1.1)) ///
	xlabel(1900(25)2000) xscale(r(1900 2000)) ///
	legend(label(1 "Moselle") label(2 "Alsace") order(1 2) pos(5) ring(0) cols(1) symx(*0.5) region(col(white))) graphregion(color(white)) /// pos(2) ring(0) 
	xline(1908 1914 1927, lpatter(dash) lcolor(gs12))
graph export "$results\EEREV-D-21-00004_FigureB7_m2.png", replace width(4200) height(3000)

cap log close
