Correcting standard errors when the independent variables are autocorrelated I have a question about how to correct standard errors when the independent variable has correlation.  In a simple time series setting we can use Newey-West covariance matrix with a bunch of lags and that will take care of the problem of correlation in the residuals.  What does one do in a panel data setting?  Imagine the situation where you observe firms over time:
$$
Y_{i,t} = a + b\Delta{X_{i,t}} + \epsilon_{i,t}
$$
where the $\Delta{X_{i,t}} = X_{i,t} - X_{i,t-n}$.  It seems that clustering standard errors on $i$ and on $t$ should fix this problem.  Am I correct?
 A: There are several ways to correct autocorrelation in a panel setting. The way you describe the clustering doesn't quite work this way. What you can do is:


*

*Cluster the standard errors on the unit identifier, e.g. the individual/firm/household ID variable. This allows for arbitrary correlation within individuals which corrects for autocorrelation.

*Calculate the Moulton factor and adjust your standard errors parametrically. If you have a balanced panel, the Moulton factor is $$M = 1 + (n-1)\rho_e$$ where $\rho_e$ is the within-individual correlation of the error. You then just need to multiply your standard errors with this factor in order to obtain an appropriate inflation of the naive standard errors which will correct for autocorrelation.

*Block bootstrap the standard errors with individuals being "blocks". Typically 200-400 bootstrap replications should be enough in order to correct your standard errors. For very large panels this approach might take a significant amount of time.


You can find more on this topic in
- Cameron and Trivedi (2010) "Microeconometrics Using Stata", Revised Edition, Stata Press
- Wooldridge (2010) "Econometric Analysis of Cross Section and Panel Data", 2nd Edition, MIT Press
