muni <- fread("C:/Users/dratnadiwakara2/Documents/OneDrive - Louisiana State University/Projects/COVID19/Muni/large_small_cities_by_state.csv")
muni[,Date:=as.Date(Date,format="%m/%d/%Y")]
muni[,week:=cut(Date, "week")]
muni[,weekno:= as.factor(week)]
muni[,weekno:= as.numeric(weekno)-39]
munisum <- muni[maturity_id<6,.(yld=mean(ytm_avg,na.rm=T)),by=.(weekno,maturity_id)]
ggplot(munisum,aes(x=weekno,y=yld,color=factor(maturity_id),group=factor(maturity_id)))+geom_line()+theme_minimal()+theme(legend.position="bottom",axis.text.x=element_text(angle=90))
This figure plots the \[\beta_w\] and the corresponding 95% confidence interval of the following regression.
\[ YTM_{c,w} = \Sigma_{w} \beta_w \times log(income)_c \times w + CityFE + Week FE + Maturity FE\]
Results suggest that YTM for bonds issued by high income cities dropped more compared to low income cities
r <- list()
r[[1]] <- felm(ytm_avg~log(income)*factor(weekno)|Ticker+weekno+maturity_id|0|Ticker,data=muni[weekno>= (-20)])
.coef_plot_1reg_line(r[[1]],"log(income):factor(weekno)",-20)+geom_vline(xintercept = 1,color="darkred")+ylab(expression(beta[w]))
This figure plots the \[\beta_w\] and the corresponding 95% confidence interval of the following regression.
\[ YTM_{c,w} = \Sigma_{w} \beta_w \times log(income)_c \times w + CityFE + Week FE + Maturity FE\]
r <- list()
r[[1]] <- felm(ytm_avg~log(income)*factor(weekno)|Ticker+weekno+maturity_id|0|Ticker,data=muni[maturity_id==1 & weekno>= (-20)])
r[[2]] <- felm(ytm_avg~log(income)*factor(weekno)|Ticker+weekno+maturity_id|0|Ticker,data=muni[maturity_id==2 & weekno>= (-20)])
r[[3]] <- felm(ytm_avg~log(income)*factor(weekno)|Ticker+weekno+maturity_id|0|Ticker,data=muni[maturity_id==3 & weekno>= (-20)])
r[[4]] <- felm(ytm_avg~log(income)*factor(weekno)|Ticker+weekno+maturity_id|0|Ticker,data=muni[maturity_id==4 & weekno>= (-20)])
coef_plot_4reg_line(r[[1]],"Maturity id = 1 ",r[[2]],"Maturity id = 2",r[[3]],"Maturity id = 3 ",r[[4]],"Maturity id = 4","log(income):factor(weekno)",-20)+geom_vline(xintercept = 1,color="darkred")+ylab(expression(beta[w]))