cd "/Users/natashasarin/Dropbox/Z__Natamir/Natasha_Research/Banks/Bailout_2016"

use "/Users/natashasarin/Dropbox/Z__Natamir/Natasha_Research/Banks/Bailout_2016/data_20160808.dta", clear


* NEW DEPENDENT VARIABLES
* vol_m
* impvol_m
* vol_thirty_m
* cds_m 

capture erase table_20160806_a.txt
foreach v in vol_m impvol_m cds_m {
reg `v' bhck7204_inv
outreg2 bhck7204_inv using table_20160806_a.txt, append bracket adjr2
}

capture erase table_20160806_b.txt
foreach v in vol_m impvol_m cds_m {
reg `v' bhck7204_inv, noconstant
outreg2 bhck7204_inv using table_20160806_b.txt, append bracket adjr2
}


*** Figure beta
lpoly beta_log_fwd bhck7204_inv, noscatter width(0.1) n(20) title(Beta and Bank Leverage) ytitle("Actual Beta") xtitle("Leverage") lineopts(lpattern(dash) lcolor(black)) graphregion(fcolor(white) style(none)) yscale(range(0 3)) xscale(range(0 25)) ylabel(0(0.5)3) xlabel(0(5)25) note("") plotregion(style(none))

graph export figure_beta_20160806.png, replace

**vol
lpoly vol_m bhck7204_inv, noscatter width(0.1) n(20) title("") ytitle("Volatility") xtitle("Leverage") lineopts(lpattern(dash) lcolor(black)) graphregion(fcolor(white) style(none)) xscale(range(0 25)) ylabel(0(5)45) yscale(range(0 45)) xlabel(0(5)25) note("") plotregion(style(none))

graph export figure_vol_20160806.png, replace

**** cds figure 
/*lpoly cds_m bhck7204_inv, noscatter width(0.1) n(20) title(CDS and Bank Leverage) ytitle(“CDS (cds_m)”) xtitle("Leverage") lineopts(lpattern(dash) lcolor(black)) graphregion(fcolor(white) style(none)) xscale(range(0 25)) ylabel(0(5)45) yscale(range(0 45)) xlabel(0(5)25) note("") plotregion(style(none))

graph export figure_cds_20160806.png, replace*/

***** impvol 

lpoly impvol_m bhck7204_inv, noscatter width(0.1) n(20) title("") ytitle(Implied Volatility) xtitle("Leverage") lineopts(lpattern(dash) lcolor(black)) graphregion(fcolor(white) style(none)) xscale(range(0 25)) ylabel(0(5)45) yscale(range(0 45)) xlabel(0(5)25) note("") plotregion(style(none))

graph export figure_impvol_20160806.png, replace
