I have a time series model that suffers from endogeneity. In other contexts it would be reasonable to use instrumental variables. However, I have not seen this done before with time series. Can I ask if it is valid to use an IV in this context and if there are any examples in the economics literature?
Solved – Time series and instrumental variables
instrumental-variablesregressiontime series
Related Solutions
The paper of Peter Ebbes et al. (2005) proposes a Latent IV estimation, where you do not need external IVs.
- Ebbes, Peter; Wedel, Michel; Böckenholt, Ulf; Steerneman, Ton; (2005). "Solving and Testing for Regressor-Error (in)Dependence When no Instrumental Variables are Available: With New Evidence for the Effect of Education on Income." Quantitative Marketing and Economics 3(4): 365-392. http://hdl.handle.net/2027.42/47579
Also the paper by Kim and Frees 2007 proposes a GMM estimation that helps you address the endogeneity problems in MLM.
- Jee-Seon Kim, & Edward W. Frees (2007). "Multilevel Modelling with Correlated Effects". Psychometrika, 72, 4, pp. 505-533.
However, I have not seen any R code for any of the two approaches :(.
In general, you cannot use plain OLS on market data to estimate demand elasticity. The one, unusual, exception would be if supply was not price sensitive (the supply curve was a straight up and down line with the same price for every quantity). The same goes for supply elasticity. See this link which explains it well. You can also see Greene's Econometric Analysis textbook (edition 5 or 7, 5 is available for free in pdf online) which covers this topic thoroughly. I will make an informal attempt at explaining below.
Suppose we want to estimate a linear supply and demand curve, something like; $$ \begin{array}{llc} q^s_t &= \alpha_0 + \alpha_1 p_t + \alpha_2 w_t+ u_t&(Supply) \\ q^d_t &= \beta_0 + \beta_1 p_t +\beta_2 y_t+ v_t&(Demand) \end{array} $$ Where $q^s_t=q^s_t$ is log quantity, $p_t$ is log price, $w_t$ are the log input costs, and $y_t$ is log consumer income. (you can have other explanatory variables too if you like, but this is the basic case).
With the above specification, the demand and supply price elasticities are $$ \frac{\partial q^s_t}{\partial p_t}= \alpha_1\;\;(Supply)\;\;\;\; \frac{\partial q^d_t}{\partial p_t} = \beta_1\;\;(Demand) $$
BUT THE ABOVE CANNOT BE ESTIMATED WITH OLS because price is endogenous. Why? because, for the market to clear, price and quantity are decided simultaneously with both demand and supply side mechanisms. For example, a firm may change it's prices in response to increases or decreases in it's competition. Such variation in prices is not exogenous but rather caused by shifts in $q^s_t$. This reverses the order of causality that would be implied by an OLS regression model of the above supply and demand functions.
Demand elasticity is generally upward bias when estimated with OLS and I am pretty sure supply elasticity is downward bias (but check the references above too, I think the bias is usually attenuating (toward 0) in all cases).
There are two prominent econometric methodologies for estimating demand/supply curves. These are
Structural equation modeling: $$ \begin{bmatrix}q_t \\ p_t \end{bmatrix} = \begin{bmatrix}\pi_0 \\ \omega_0 \end{bmatrix} + \begin{bmatrix}\pi_1 & \pi_2 \\ \omega_1&\omega_2 \end{bmatrix}\begin{bmatrix}w_t \\ y_t \end{bmatrix}+\begin{bmatrix}e_{1,t} \\ e_{2,t} \end{bmatrix}$$ which is a multivariate likelihood.
Instrumental Variables (as suggested in your question). In the case of demand this is: $$\begin{array}{llc} p_t &= \omega_0 + \omega_1 w_t + \omega_2 y_t + e_t&(First\;Stage) \\ q^d_t &= \beta_0 + \beta_1 \hat p_t +\beta_2 y_t+ v_t&(Second\;Stage) \end{array} $$
$w_t$ works as an instrument because it acts like an exogenous “shifter” in supply. The basic idea is that by moving the supply curve up and down and recording the equilibrium quantities and prices, we can trace out the demand curve. The assumption here is that the suppliers cannot control their input costs (this is not always true when suppliers can negotiate their input costs as in oligopsony but we assume it is here). For supply we would use the same methodology but with $y_t$ as the instrument.
Best Answer
Consider a series $Y_t$ generated as an $ARMA(1,1)$ process $$ Y_t=\phi Y_{t-1}+\epsilon_t+\theta\epsilon_{t-1} $$ Suppose our interest centers on estimating $\phi$. We have an endogeneity issue here, as the error term $\epsilon_t+\theta\epsilon_{t-1}$ is correlated with the regressor $Y_{t-1}$, so OLS of $Y_{t}$ on $Y_{t-1}$ would not consistently estimate $\phi$: $$ \hat{\phi}_{OLS}=\frac{\sum_tY_{t-1}Y_{t}}{\sum_tY_{t-1}^2}=\frac{\frac{1}{T}\sum_tY_{t-1}Y_{t}}{\frac{1}{T}\sum_tY_{t-1}^2}\to_p\frac{\gamma_1}{\gamma_0}, $$ where the convergence in probability follows from standard arguments about plims of $\frac{1}{T}\sum_tY_{t-j}Y_{t-l}$ and the continuous mapping theorem. Now, it is known that $\gamma_0=\sigma^2\frac{1+\theta^2+2\phi\theta}{1-\phi^2}$ and $\gamma_1=\sigma^2\frac{(\phi+\theta)(1+\phi\theta)}{1-\phi^2}$. Hence, \begin{eqnarray*} \hat{\phi}&\to_p&\frac{\sigma^2\frac{(\phi+\theta)(1+\phi\theta)}{1-\phi^2}}{\sigma^2\frac{1+\theta^2+2\phi\theta}{1-\phi^2}}\\ &=&\frac{(\phi+\theta)(1+\phi\theta)}{1+\theta^2+2\phi\theta}\neq\phi, \end{eqnarray*} unless the process is an $AR(1)$, i.e. unless $\theta=0$.
Instrumental variables estimation of $\phi$ using $Y_{t-2}$ as an instrument for $Y_{t-1}$, in turn, is consistent for $\phi$: the IV estimator is $$ \hat{\phi}_{IV}=\frac{\sum_tY_{t-2}Y_{t}}{\sum_tY_{t-2}Y_{t-1}}=\frac{\frac{1}{T}\sum_tY_{t-2}Y_{t}}{\frac{1}{T}\sum_tY_{t-2}Y_{t-1}}\to_p\frac{\gamma_2}{\gamma_1} $$ We furthermore know that the autocovariance function of an $ARMA(1,1)$ is such that $\gamma_2=\phi\gamma_1$. Hence, $$\hat{\phi}_{IV}\to_p\phi$$ This works because the error term in this IV model, $\epsilon_t+\theta\epsilon_{t-1}$, is uncorrelated with the instrument, which itself is correlated with the regressor $Y_{t-1}$ due to the autoregressive structure of the process.
While this simple example (and I think simple examples are useful) shows how to use instruments in time series analysis, it is somewhat artificial in that if one knew that the process is $ARMA(1,1)$ one could estimate such a process directly. And it is somewhat fragile in that if the process were $ARMA(1,2)$, $Y_{t-2}$ would no longer be a valid instrument, as it would now be correlated with the new error $\epsilon_t+\theta_1\epsilon_{t-1}+\theta_2\epsilon_{t-2}$.