Load Dataset
load("Ozone Data with Region (1).RData")
df4$USDM.categorical<-factor(df4$USDM.categorical,levels=c("NoDrought","ModerateDrought","SevereDrought"))
df4$modest<-ifelse(df4$USDM.categorical=="ModerateDrought",1,0)
df4$severe<-ifelse(df4$USDM.categorical=="SevereDrought",1,0)
area<-unique(df4$noaa_region)%>%sort()
#makes a function
UAdj_Mod<-function(region,df){
gh<-df%>%filter(noaa_region==region)
model<-felm(Max.Ozone~modest+severe+elevation|GEOID + Year+month | 0|GEOID,
data=gh)
}
Ajd_Mod<-function(region,df){
gh<-df%>%filter(noaa_region==region)
model<-felm(Max.Ozone~modest+severe+elevation+Longitude+Latitude |GEOID + Year+month | 0 |GEOID,
data=gh)
}
F_Ajd<-function(region,df){
gh<-df%>%filter(noaa_region==region)
model<-felm(Max.Ozone~modest+severe+elevation+tdmean+tmean+ppt+Longitude+Latitude |GEOID + Year+month | 0 |GEOID,
data=gh)
}
Model
for(i in 1:9){
assign(paste0("Uadj_",i),value = UAdj_Mod(area[i],df4))
}
for(i in 1:9){
assign(paste0("Adj_",i),value = Ajd_Mod(area[i],df4))
}
for(i in 1:9){
assign(paste0("FAdj_",i),value = F_Ajd(area[i],df4))
}
Arrange tables Unadjust Model
stargazer(Uadj_1,Uadj_2,Uadj_3,type="text",title = "Compare noaa area",align = TRUE,
column.labels = c(paste0("Unadjust ",area[1]),paste0("Unadjust ",area[2]),paste0("Unadjust ",area[3])),
dep.var.caption = "Dependent Variable: Max Ozone",
dep.var.labels.include = FALSE,omit.table.layout = "#")
##
## Compare noaa area
## =================================================================================
## Dependent Variable: Max Ozone
## -------------------------------------------------------------
## Unadjust northeast Unadjust northern Unadjust northwest
## ---------------------------------------------------------------------------------
## modest 1.174*** 0.410** 0.519**
## (0.137) (0.169) (0.247)
##
## severe -1.164** 0.563 0.124
## (0.466) (0.359) (0.425)
##
## elevation 0.015*** 0.005*** 0.010***
## (0.001) (0.001) (0.001)
##
## ---------------------------------------------------------------------------------
## Observations 960,225 226,906 105,338
## R2 0.345 0.485 0.368
## Adjusted R2 0.345 0.485 0.368
## Residual Std. Error 11.858 (df = 960040) 7.551 (df = 226823) 10.001 (df = 105276)
## =================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
stargazer(Uadj_4,Uadj_5,Uadj_6,type="text",title = "Compare noaa area",align = TRUE,
column.labels = c(paste0("Unadjust ",area[4]),paste0("Unadjust ",area[5]),paste0("Unadjust ",area[6])),
dep.var.caption = "Dependent Variable: Max Ozone",
dep.var.labels.include = FALSE,omit.table.layout = "#")
##
## Compare noaa area
## ===================================================================================
## Dependent Variable: Max Ozone
## ---------------------------------------------------------------
## Unadjust ohio Unadjust south Unadjust southeast
## -----------------------------------------------------------------------------------
## modest 1.705*** 1.018*** 2.144***
## (0.180) (0.147) (0.155)
##
## severe 3.029*** 1.692*** 3.338***
## (0.526) (0.298) (0.197)
##
## elevation -0.003 0.021*** 0.011***
## (0.003) (0.004) (0.003)
##
## -----------------------------------------------------------------------------------
## Observations 1,006,480 951,486 982,391
## R2 0.337 0.234 0.216
## Adjusted R2 0.336 0.234 0.216
## Residual Std. Error 11.864 (df = 1006263) 12.615 (df = 951326) 12.255 (df = 982194)
## ===================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
stargazer(Uadj_7,Uadj_8,Uadj_9,type="text",title = "Compare noaa area",align = TRUE,
column.labels = c(paste0("Unadjust ",area[7]),paste0("Unadjust ",area[8]),paste0("Unadjust ",area[9])),
dep.var.caption = "Dependent Variable: Max Ozone",
dep.var.labels.include = FALSE,omit.table.layout = "#")
##
## Compare noaa area
## ==================================================================================
## Dependent Variable: Max Ozone
## --------------------------------------------------------------
## Unadjust southwest Unadjust upper Unadjust west
## ----------------------------------------------------------------------------------
## modest 0.009 0.892*** 0.083
## (0.156) (0.138) (0.234)
##
## severe 0.128 1.262*** 0.433
## (0.222) (0.449) (0.317)
##
## elevation 0.007*** 0.027** 0.005***
## (0.001) (0.012) (0.002)
##
## ----------------------------------------------------------------------------------
## Observations 683,530 382,355 1,290,716
## R2 0.505 0.247 0.476
## Adjusted R2 0.505 0.247 0.476
## Residual Std. Error 8.788 (df = 683432) 11.332 (df = 382237) 11.850 (df = 1290625)
## ==================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
Arrange tables Adjusted Model
stargazer(Adj_1,Adj_2,Adj_3,type="text",title = "Compare noaa area",align = TRUE,
column.labels = c(paste0("Adjusted ",area[1]),paste0("Adjusted ",area[2]),paste0("Adjusted ",area[3])),
dep.var.caption = "Dependent Variable: Max Ozone",
dep.var.labels.include = FALSE,omit.table.layout = "#")
##
## Compare noaa area
## ================================================================================
## Dependent Variable: Max Ozone
## ------------------------------------------------------------
## Adjusted northeast Adjusted northern Adjusted northwest
## --------------------------------------------------------------------------------
## modest 1.183*** 0.410** 0.439*
## (0.135) (0.168) (0.232)
##
## severe -1.124** 0.556 -0.102
## (0.465) (0.361) (0.377)
##
## elevation 0.016*** 0.005*** 0.013***
## (0.001) (0.001) (0.001)
##
## Longitude 3.898*** -1.027 -4.741*
## (1.219) (0.876) (2.450)
##
## Latitude -3.593** 0.366 -1.728
## (1.569) (0.724) (4.378)
##
## --------------------------------------------------------------------------------
## Observations 960,225 226,906 105,338
## R2 0.346 0.485 0.373
## Adjusted R2 0.346 0.485 0.373
## Residual Std. Error 11.851 (df = 960038) 7.548 (df = 226821) 9.959 (df = 105274)
## ================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
stargazer(Adj_4,Adj_5,Adj_6,type="text",title = "Compare noaa area",align = TRUE,
column.labels = c(paste0("Adjusted ",area[4]),paste0("Adjusted ",area[5]),paste0("Adjusted ",area[6])),
dep.var.caption = "Dependent Variable: Max Ozone",
dep.var.labels.include = FALSE,omit.table.layout = "#")
##
## Compare noaa area
## ===================================================================================
## Dependent Variable: Max Ozone
## ---------------------------------------------------------------
## Adjusted ohio Adjusted south Adjusted southeast
## -----------------------------------------------------------------------------------
## modest 1.703*** 1.017*** 2.144***
## (0.180) (0.147) (0.155)
##
## severe 3.028*** 1.686*** 3.338***
## (0.526) (0.296) (0.197)
##
## elevation -0.004 0.015*** 0.011***
## (0.003) (0.004) (0.002)
##
## Longitude 2.106 -0.057 0.126
## (1.579) (0.827) (1.483)
##
## Latitude -1.294 3.411*** -0.191
## (1.119) (1.277) (2.226)
##
## -----------------------------------------------------------------------------------
## Observations 1,006,480 951,486 982,391
## R2 0.337 0.235 0.216
## Adjusted R2 0.337 0.234 0.216
## Residual Std. Error 11.863 (df = 1006261) 12.612 (df = 951324) 12.256 (df = 982192)
## ===================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
stargazer(Adj_7,Adj_8,Adj_9,type="text",title = "Compare noaa area",align = TRUE,
column.labels = c(paste0("Adjusted ",area[7]),paste0("Adjusted ",area[8]),paste0("Adjusted ",area[9])),
dep.var.caption = "Dependent Variable: Max Ozone",
dep.var.labels.include = FALSE,omit.table.layout = "#")
##
## Compare noaa area
## ==================================================================================
## Dependent Variable: Max Ozone
## --------------------------------------------------------------
## Adjusted southwest Adjusted upper Adjusted west
## ----------------------------------------------------------------------------------
## modest 0.016 0.907*** 0.083
## (0.157) (0.136) (0.240)
##
## severe 0.145 1.270*** 0.434
## (0.218) (0.449) (0.330)
##
## elevation 0.007*** 0.003 0.005***
## (0.001) (0.011) (0.002)
##
## Longitude 1.495 3.902 -0.118
## (1.322) (2.422) (1.353)
##
## Latitude 2.350* 5.274*** -0.301
## (1.353) (1.337) (2.482)
##
## ----------------------------------------------------------------------------------
## Observations 683,530 382,355 1,290,716
## R2 0.506 0.249 0.476
## Adjusted R2 0.506 0.249 0.476
## Residual Std. Error 8.777 (df = 683430) 11.320 (df = 382235) 11.850 (df = 1290623)
## ==================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
Arrange tables Full Adjusted Model
stargazer(FAdj_1,FAdj_2,FAdj_3,type="text",title = "Compare noaa area",align = TRUE,
column.labels = c(paste0("Full Adjusted ",area[1]),paste0("Full Adjusted ",area[2]),paste0("Full Adjusted ",area[3])),
dep.var.caption = "Dependent Variable: Max Ozone",
dep.var.labels.include = FALSE,omit.table.layout = "#")
##
## Compare noaa area
## ==========================================================================================
## Dependent Variable: Max Ozone
## ----------------------------------------------------------------------
## Full Adjusted northeast Full Adjusted northern Full Adjusted northwest
## ------------------------------------------------------------------------------------------
## modest 0.566*** 0.116 0.473**
## (0.140) (0.169) (0.201)
##
## severe -1.384*** 0.183 0.171
## (0.474) (0.327) (0.320)
##
## elevation 0.018*** 0.006*** 0.012***
## (0.001) (0.001) (0.001)
##
## tdmean -0.890*** -0.457*** -1.176***
## (0.021) (0.039) (0.124)
##
## tmean 1.325*** 0.485*** 1.400***
## (0.029) (0.043) (0.155)
##
## ppt -0.114*** -0.111*** 0.163***
## (0.005) (0.011) (0.032)
##
## Longitude 4.806*** -0.903 -5.211**
## (1.353) (0.872) (2.141)
##
## Latitude -3.515** 0.805 -5.482
## (1.727) (0.807) (5.361)
##
## ------------------------------------------------------------------------------------------
## Observations 960,225 226,906 105,338
## R2 0.406 0.521 0.486
## Adjusted R2 0.406 0.521 0.485
## Residual Std. Error 11.293 (df = 960035) 7.282 (df = 226818) 9.024 (df = 105271)
## ==========================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
stargazer(FAdj_4,FAdj_5,FAdj_6,type="text",title = "Compare noaa area",align = TRUE,
column.labels = c(paste0("Full Adjusted ",area[4]),paste0("Full Adjusted ",area[5]),paste0("Full Adjusted ",area[6])),
dep.var.caption = "Dependent Variable: Max Ozone",
dep.var.labels.include = FALSE,omit.table.layout = "#")
##
## Compare noaa area
## ======================================================================================
## Dependent Variable: Max Ozone
## ------------------------------------------------------------------
## Full Adjusted ohio Full Adjusted south Full Adjusted southeast
## --------------------------------------------------------------------------------------
## modest 0.635*** 0.122 1.378***
## (0.139) (0.122) (0.122)
##
## severe 1.236*** -0.087 2.025***
## (0.410) (0.369) (0.143)
##
## elevation 0.003 0.019*** 0.016***
## (0.003) (0.005) (0.002)
##
## tdmean -1.384*** -1.247*** -1.758***
## (0.043) (0.216) (0.038)
##
## tmean 1.642*** 1.245*** 2.051***
## (0.035) (0.228) (0.058)
##
## ppt -0.163*** -0.092*** -0.103***
## (0.004) (0.017) (0.007)
##
## Longitude 2.390 1.288 -0.556
## (1.811) (0.985) (1.301)
##
## Latitude -0.595 2.500* -0.509
## (1.253) (1.469) (2.100)
##
## --------------------------------------------------------------------------------------
## Observations 1,006,480 951,486 982,391
## R2 0.433 0.331 0.335
## Adjusted R2 0.433 0.331 0.335
## Residual Std. Error 10.967 (df = 1006258) 11.788 (df = 951321) 11.283 (df = 982189)
## ======================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
stargazer(FAdj_7,FAdj_8,FAdj_9,type="text",title = "Compare noaa area",align = TRUE,
column.labels = c(paste0("Full Adjusted ",area[7]),paste0("Full Adjusted ",area[8]),paste0("Full Adjusted ",area[9])),
dep.var.caption = "Dependent Variable: Max Ozone",
dep.var.labels.include = FALSE,omit.table.layout = "#")
##
## Compare noaa area
## ======================================================================================
## Dependent Variable: Max Ozone
## ------------------------------------------------------------------
## Full Adjusted southwest Full Adjusted upper Full Adjusted west
## --------------------------------------------------------------------------------------
## modest -0.126 0.449*** 0.130
## (0.154) (0.120) (0.274)
##
## severe -0.172 1.111*** 0.274
## (0.228) (0.377) (0.318)
##
## elevation 0.007*** -0.0001 0.009***
## (0.001) (0.012) (0.001)
##
## tdmean -0.241*** -1.003*** -0.401***
## (0.021) (0.036) (0.063)
##
## tmean 0.316*** 1.456*** 1.127***
## (0.049) (0.040) (0.116)
##
## ppt -0.150*** -0.139*** 0.126***
## (0.026) (0.006) (0.020)
##
## Longitude 1.798 5.087** -2.562**
## (1.221) (2.033) (1.155)
##
## Latitude 2.164* 6.457*** -2.182
## (1.221) (1.133) (2.446)
##
## --------------------------------------------------------------------------------------
## Observations 683,530 382,355 1,290,716
## R2 0.526 0.342 0.546
## Adjusted R2 0.526 0.342 0.546
## Residual Std. Error 8.595 (df = 683427) 10.598 (df = 382232) 11.032 (df = 1290620)
## ======================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01