version 0.0.1, 17 Nov 2020

Instrumental variables regression with Conley, HAC-robust standard errors

spatial_hac_iv -- Runs an instrumental variable regression, adjusting standard errors for spatial correlation, heteroskedasticity, and autocorrelation

Author

Tim Foreman

RFF-CMCC European Institute on Economics and the Environment

timothy.foreman@eiee.org

Syntax

spatial_hac_iv depvar indepvar (endog=inst), lon(varname) lat(varname) timevar(varname) panelvar(varname) distcutoff(#) lagcutoff(#) [bartlett dropvar]

lat Latitude variable (degrees)

lon Longitude variable (degrees)

timevar Time variable

panelvar Panel variable

distcutoff Distance cutoff for spatial correlation within a time unit (kilometers)

lagcutoff Time cutoff for autocorrelation within a panel unit

bartlett Use a linear bartlett window for spatial correlations, instead of a uniform kernel

dropvar Drops variables that Stata would drop due to collinearity

Example

Regress y on endogenous variable x with instrument z
. spatial_hac_iv y (x=z), lat(lat) lon(lon) timevar(year) panelvar(countrynum) lagcutoff(5) distcutoff(100) dropvar

Acknowledgements

The basis for this package was written by Solomon Hsiang and Kyle Meng. It relies on ivreg2, written by Christopher F Baum, Mark E Schaffer, and Steven Stillman
http://ideas.repec.org/c/boc/bocode/s425401.html