14 Introduction to Time Series Regression and Forecasting
Time series data is collected for a single entity over time. This is fundamentally different from cross-section data which is data on multiple entities at the same point in time. Time series data allows estimation of the effect on \(Y\) of a change in \(X\) over time. This is what econometricians call a dynamic causal effect. Let us go back to the application of cigarette consumption of Chapter 12 where we were interested in estimating the effect on cigarette demand of a price increase caused by a raise of the general sales tax. One might use time series data to assess the causal effect of a tax increase on smoking both, initially and in subsequent periods.
Another application of time series data is forecasting. For example, weather services use time series data to predict tomorrow’s temperature by, inter alia, using today’s temperature and temperatures of the past. To motivate an economic example, central banks are interested in forecasting next month’s unemployment rates.
The remaining chapters in the book deal with econometric techniques for analyzing time series data, as well as their applications in forecasting and estimating dynamic causal effects. This section covers the basic concepts presented in Chapter 14 of the book, explains how to visualize time series data and demonstrates how to estimate simple autoregressive models, where the regressors are past values of the dependent variable or other variables. In this context we also discuss the concept of stationarity, an important property which has far-reaching consequences.
Most empirical applications in this chapter are concerned with forecasting and use data on U.S. macroeconomic indicators or financial time series like Gross Domestic Product (GDP), the unemployment rate or excess stock returns.
The following packages and their dependencies are needed for reproduction of the code chunks presented throughout this chapter:
- AER (Christian Kleiber and Zeileis 2008),
- dynlm (Zeileis 2019),
- forecast (Hyndman et al. 2023),
- readxl (Wickham and Bryan 2023),
- stargazer (Hlavac 2022),
- scales (Wickham and Seidel 2022),
- quantmod (Ryan and Ulrich 2023),
- urca (B. Pfaff 2008).
Please verify that the following code chunk runs on your machine without any errors.