This book is in Open Review. We want your feedback to make the book better for you and other students. You may annotate some text by selecting it with the cursor and then click the on the pop-up menu. You can also see the annotations of others: click the in the upper right hand corner of the page

# 15 Estimation of Dynamic Causal Effects

It sometimes is of interest to know the size of current and future reaction of $Y$ to a change in $X$. This is called the dynamic causal effect on $Y$ of a change in $X$. This Chapter we discusses how to estimate dynamic causal effects in R applications, where we investigate the dynamic effect of cold weather in Florida on the price of orange juice concentrate.

The discussion covers:

• estimation of distributed lag models
• heteroskedasticity- and autocorrelation-consistent (HAC) standard errors
• generalized least squares (GLS) estimation of ADL models

To reproduce code examples, install the R packages listed below beforehand and make sure that the subsequent code chunk executes without any errors.

• AER
• dynlm
• nlme
• orcutt
• quantmod
• stargazer
library(AER)
library(quantmod)
library(dynlm)
library(orcutt)
library(nlme)
library(stargazer)

### References

Hlavac, Marek. 2018. stargazer: Well-Formatted Regression and Summary Statistics Tables (version 5.2.2). https://CRAN.R-project.org/package=stargazer.
Kleiber, Christian, and Achim Zeileis. 2020. AER: Applied Econometrics with R (version 1.2-9). https://CRAN.R-project.org/package=AER.
Pinheiro, José, Douglas Bates, and R-core. 2021. nlme: Linear and Nonlinear Mixed Effects Models (version 3.1-152). https://svn.r-project.org/R-packages/trunk/nlme/.
Ryan, Jeffrey A., and Joshua M. Ulrich. 2020. quantmod: Quantitative Financial Modelling Framework (version 0.4.18). https://CRAN.R-project.org/package=quantmod.
Spada, Stefano. 2018. orcutt: Estimate Procedure in Case of First Order Autocorrelation (version 2.3). https://CRAN.R-project.org/package=orcutt.
Zeileis, Achim. 2019. dynlm: Dynamic Linear Regression (version 0.3-6). https://CRAN.R-project.org/package=dynlm.