use state city newspaper frequency affiliation estab newspapers_hit_monday using"$dir_root/Data/searches/US_1910_Hits.dta" if inlist(state,"Alabama","Washington","Massachusetts","Nebraska"), clear

*Grab standardized frequency variable
merge 1:1 state city newspaper frequency affiliation estab using "$dir_root/Data/_temp/us_1910_directory", keepusing(frequency_std affiliation_std black_paper foreign_language_paper) keep(1 3) nogen

keep if inlist(frequency_std,"d","w","tw","thrice")

gen present=(newspapers_hit_monday==1)

gen daily=(frequency_std=="d")

gen type_democrat=(affiliation_std=="democrat")
gen type_republican=(affiliation_std=="republican")
gen type_independent=(affiliation_std=="independent")

gen type_trade=(affiliation_std=="trade" | affiliation_std=="agricultural")

gen type_religious=(affiliation_std=="religious")

destring estab, ignore("?") replace
gen yrs_since_est=1910-estab
drop if yrs_since_est==.

**** Regressions
label variable daily "Daily"
label variable type_democrat "Democratic
label variable type_republican "Republican"
label variable type_independent "Independent"
label variable type_trade "Trade/Bus."
label variable type_religious "Religious"
label variable yrs_since_est "Years Since Est."

label variable black_paper "Black Paper"
label variable foreign_language_paper "Foreign Language Paper"

*Combined
eststo T9_1: reg present daily type_* black_paper foreign_language_paper yrs_since_est, robust

*By State
eststo T9_2: reg present daily type_* black_paper foreign_language_paper yrs_since_est if state=="Alabama", robust
eststo T9_3: reg present daily type_* black_paper foreign_language_paper yrs_since_est if state=="Massachusetts", robust
eststo T9_4: reg present daily type_* black_paper foreign_language_paper yrs_since_est if state=="Nebraska", robust
eststo T9_5: reg present daily type_* black_paper foreign_language_paper yrs_since_est if state=="Washington", robust

esttab T9_* using "$dir_root/Results/T8_US_selection_regs", label keep(daily type_* black_paper foreign_language_paper yrs_since_est) stats(N r2, label("Observations" "R-squared") fmt(0 3)) b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) tex replace
