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

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

**** REPLICATION OF TABLE 9 ****

clear all
set mem 2g
set more off

/*	
	OUTLINE
	1. REGRESSIONS
	2. TABLE FOR PAPER
*/

********************************
***** 1. REGRESSIONS *****
********************************

// Import survey data

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

keep if dep_inc==1

// Clustering

egen cluster=group(birthyr alsace)

// Transmission

drop born_1908_1913
g born_1908_1913=1*(birthyr>=1908 & birthyr<=1913 & sexe==1)
g born_1908_1913_fem=1*(birthyr>=1908 & birthyr<=1913 & sexe==2)

reghdfe confiance11 alsace /// 
	c.born_1908_1913_fem#c.alsace c.born_1908_1913#c.alsace c.p_g1_1908_1913#c.alsace c.p_g2_1908_1913#c.alsace if birthyr>1907, ///
	cluster(i.birthyr#i.alsace) a(i.birthyr#i.sexe i.nationalite_pop i.religion i.anciennete i.annee) //
estimates store transmission
qui sum confiance11 if e(sample)
scalar mean_y=r(mean)
estadd scalar mean_y

// Months at the front

ivreghdfe confiance11 alsace c.born_1908_1913#c.alsace c.born_1911_1913#c.alsace ///
	if birthyr>=1908 & birthyr<=1927 & sexe==1, cluster(cluster) a(i.birthyr#i.sexe i.nationalite_pop i.religion i.anciennete i.annee) //
estimates store months
qui sum confiance11 if e(sample)
scalar mean_y=r(mean)
estadd scalar mean_y

// Casualties (spouses)

ivreghdfe confiance11 alsace c.p_s_1908_1913#c.alsace ///
	if birthyr>=1908 & birthyr<=1927 & sexe==2, cluster(cluster) a(i.birthyr#i.sexe i.nationalite_pop i.religion i.anciennete i.annee) //
estimates store spouse
qui sum confiance11 if e(sample)
scalar mean_y=r(mean)
estadd scalar mean_y

// Only first gen, other aspects

foreach var in dipl_sup lrev business association memberFN{ // 

	ivreghdfe `var' alsace c.born_1908_1913#c.alsace ///
		if birthyr>=1908 & birthyr<=1927 & sexe==1, cluster(cluster) a(i.birthyr#i.sexe i.nationalite_pop i.religion i.anciennete i.annee) //
	estimates store `var'
	qui sum `var' if e(sample)
	scalar mean_y=r(mean)
	estadd scalar mean_y

}

******************************
***** 2. TABLE FOR PAPER *****
******************************

// Fixed effects

estfe . association memberFN dipl_sup lrev business transmission months spouse, labels(nationalite_pop "Individual controls" annee "Survey year FE" birthyr#sexe "YoB $ \times $ gender FE") // proximite_enc "Political proximity FE")
return list

// Labels

la var alsace 				"Alsace"
la var born_1908_1913 		"[0.3em] Born 1908-1913" 
la var born_1911_1913 		"[0.3em] Born 1911-1913" 
la var born_1908_1913_fem 	"[0.3em] B. 1908-13 (Woman)" 
la var p_g1_1908_1913 		"[0.3em] B. 1908-13 (Father)" 
la var p_g2_1908_1913 		"[0.3em] B. 1908-13 (G.-father)" 
la var p_s_1908_1913 		"[0.3em] B. 1908-13 (Husband)" 

// Table

estout transmission months spouse dipl_sup lrev business association memberFN ///
	using "$results\\$program.tex", replace style(tex) type label ///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  ///
	collabels(none) ///
	mlabels(, span none prefix(\multicolumn{@span}{c}{) suffix(})) ///
	msign(--) starlevels(* .1 ** .05 *** .01) ///
	keep(alsace c.born_1908_1913#c.alsace c.born_1908_1913_fem#c.alsace c.born_1911_1913#c.alsace c.p_g1_1908_1913#c.alsace c.p_g2_1908_1913#c.alsace c.p_s_1908_1913#c.alsace) ///
	order(alsace c.born_1908_1913#c.alsace c.born_1908_1913_fem#c.alsace c.p_g1_1908_1913#c.alsace c.p_g2_1908_1913#c.alsace c.born_1911_1913#c.alsace c.p_s_1908_1913#c.alsace) ///
	varlabels(c.p_s_1908_1913#c.alsace "[0.3em] B 08-13 (Husband) $ \times $ Als." c.born_1908_1913_fem#c.alsace "[0.3em] B. 08-13 (Woman) $ \times $ Als." c.p_g1_1908_1913#c.alsace "[0.3em] B. 08-13 (Father) $ \times $ Als." c.p_g2_1908_1913#c.alsace "[0.3em] B. 08-13 (G.-father) $ \times $ Als.") ///
	title(Party proximity and trust in institutions: Channels of persistence) ///
	prehead("\begin{table}[t!]" ///
	"\begin{center}" ///
	"\begin{threeparttable}" ///
	"\begin{scriptsize}" ///
	"\caption{@title}\label{$program}" ///
	"\begin{tabular*}{\columnwidth}{@{\extracolsep{\stretch{1}}}l*{@M}{c}@{}}" ///
	"\hline" "\hline" ///
	"&\multicolumn{1}{c}{(1)} 		&\multicolumn{1}{c}{(2)}  		&\multicolumn{1}{c}{(3)} 	&\multicolumn{1}{c}{(4)} 	&\multicolumn{1}{c}{(5)}  	&\multicolumn{1}{c}{(6)}		&\multicolumn{1}{c}{(7)} &\multicolumn{1}{c}{(8)}	\\" ///	
	" &\multicolumn{1}{c}{Transmission} & \multicolumn{2}{c}{Service \& casualties} &\multicolumn{3}{c}{Human capital \& income} &\multicolumn{2}{c}{Organizational skills} \\" /// 
	"\cmidrule(lr){2-2} \cmidrule(lr){3-4} \cmidrule(lr){5-7} \cmidrule(lr){8-9}" /// 
	"\multicolumn{1}{l}{\textit{Dep. Variable}}	&\multicolumn{1}{c}{Trust} 			&\multicolumn{1}{c}{Trust}  	 &\multicolumn{1}{c}{Trust} 	 &\multicolumn{1}{c}{Higher}		&\multicolumn{1}{c}{Log}  	&\multicolumn{1}{c}{Owns}  		&\multicolumn{1}{c}{Party}		&\multicolumn{1}{c}{Member}			 \\" ///
	"&\multicolumn{1}{c}{politicians} 	&\multicolumn{1}{c}{politicians} &\multicolumn{1}{c}{politicians} 	&\multicolumn{1}{c}{education} 	&\multicolumn{1}{c}{income} &\multicolumn{1}{c}{business}	&\multicolumn{1}{c}{member} 	&\multicolumn{1}{c}{\& Rad right}	\\" /// 
	"\hline \\") ///
	posthead("") ///
	prefoot("") ///
	postfoot("")

estout transmission months spouse dipl_sup lrev business association memberFN /// 
	using "$results\\$program.tex", append style(tex) type label ///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  ///
	stats(mean_y N N_clust, lab("Mean dep. variable" "Observations" "Clusters") fmt(3 %9.0fc %9.0fc)) ///
	collabels(none) ///
	mlabels(, span none prefix(\multicolumn{@span}{c}{) suffix(})) ///
	msign(--) starlevels(* .1 ** .05 *** .01) ///
	drop(*) /// 
	indicate( ///	
	"Individual controls = 0.nationalite_pop" ///	
	"Survey year FE = 0.annee" ///	
	"Year-of-birth FE = 0.birthyr#0.sexe" ///
	, labels(Yes )) ///
	prehead("") /// 
	posthead("\\") ///
	prefoot("\hline") ///
	postfoot("\hline" "\hline" ///
	"\end{tabular*}" /// 
	"\end{scriptsize}" ///
	"\begin{tablenotes}[normal,flushleft]" ///
	"\begin{scriptsize}" ///
	"\item \emph{Notes}:" /// 
	"Reduced-form estimates of the potential mechanism. " ///
	"Data comes from the Interregional survey of political phenomena (\textit{Enqu\^ete interr\'egionale des ph\'enomenes politiques}). " ///
	"The unit of observation is an individual. " ///
	"Standard errors clustered at year-of-birth $ \times $ region level in parentheses. " ///
	"Column (1): Intergenerational transmission of attitudes; " ///
	"Columns (2) and (3): Length of service and casualties; " ///
	"Columns (4) to (6): Human capital and earnings; " ///
	"Columns (7) and (8): Organizational skills. " ///
	"Year-of-birth $ \times $ gender fixed effects are included in all specifications. " ///
	"* significant at 10\%; ** at 5\%; *** at 1\%. " ///	
	"\end{scriptsize}" ///
	"\end{tablenotes}" ///
	"\end{threeparttable} " ///
	"\end{center}" ///
	"\end{table}") //

cap log close
