Local Projections

In this recent NBER working paper, Òscar Jordà and Alan M. Taylor offer a survey of the best practice about recent developments on Local Projections (LP). The paper provides large coverage of different problems related to the application of the LP method in applied economics. The paper is accompanied by a GitHub repository where all the computations and figures in the WP are reproduced. That is perfect if you want to learn and practice, like me. I managed to reproduced all the examples on my own computer.

I was particularly interested in the inference part and, especially, in the lag-augmented LP part in the subsection 6.3. They indicate that lag-augmentation (see the lagged bold in the code snippet below) performs similarly to the Newey-West correction:

*** Generate the forward variables and reg
gen h=_n-1

forvalues i = 0/`h'{
	newey f`i'.x y l.y l.x, lag(6)
	replace b 	= _b[y] 	if h == `i'
	replace snw	= _se[y] 	if h == `i'
	
	reg f`i'.x y l(1/2).y l(1/2).x, vce(hc3)
	replace sla	= _se[y] 	if h == `i'
	
}

*** Compare the error bands
gen unw		=	b + invnormal(1 -$p/2)*snw
gen dnw		=	b - invnormal(1 -$p/2)*snw

gen ula		=	b + invnormal(1 -$p/2)*sla
gen dla		=	b - invnormal(1 -$p/2)*sla

gen zero	= 0 

Reference

Òscar Jordà, and Alan M Taylor. “Local Projections.” National Bureau of Economic Research, August 12, 2024. https://www.nber.org/papers/w32822.

2 Comments

Dear Jamal,
Thank you for sharing the code. I tried replicating the code with my data but couldn’t generate a result [invalid syntax].
Did you check whether the codes work with STATA 17? Plus, does the code entertain exogenous variables or order next to the response variable and shock variable?
Thanks

Dear Gabriel,
Many thanks for your interested and your question, I used Stata Now 18.5 for the replication.
As I have no longer access to Stata 17, I am not sure on what’s happening with your own setup.
Kind regards,
Jamel

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.