/***************
* Create a matrix of summary statistics for
* turnout and demshare to put in
* table D2 
***************/

use "$data2/balpal_turnout_tabled2", clear
keep *fip* cong_tout cong_dpct year

collapse (mean) cong_tout cong_dpct (median) ctout_med=cong_tout cdpct_med=cong_dpct (sd) ctout_sd=cong_tout cdpct_sd=cong_dpct, by(year)

order year *tout* *dpct*
outsheet using "$output/table_d2.txt", replace
