1. Econ 2015 Time Series: Serial Correlation
Sheng-Kai Chang
NTU
Spring 2016
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 1 / 28
2. 1. Properties of OLS Under Serial Correlation
Recall the model written in its usual form:
yt = Ī²0 + Ī²1xt1 + ... + Ī²k xtk + ut
Serial correlation means that the errors, fut : t = 1, 2, ...g are correlated.
Serial correlation has nothing directly to do with unbiasedness or
consistency of OLS. If the expected value of ut does not depend on any of
the explanatory variables in any time period āso the explanatory variables
are strictly exogenous, Assumption TS.3 āthen OLS is unbiased.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 2 / 28
3. If ut is uncorrelated with the explantory variables at time t āthe
explanatory variables are contemporaneously exogenous, Assumption TS.30
āthen OLS is consistent, provided the time series are weakly dependent.
There is little to worry about with static and ā¦nite distributed lag
regression models concerning consistency in the presence of serial
correlation.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 3 / 28
4. But serially correlated errors means the usual OLS statistical inference is
incorrect, even in large samples. In many cases, the inference can be very
misleading. (Heteroskedasticity also invalidates the usual inference in TS
regressions, just as with CS regressions.)
In some cases, we can improve over OLS by modeling the serial
correlation and using a diĀ¤erent estimation method, but additional
assumptions are needed.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 4 / 28
5. It is commonly thought that serial correlation invalidates R2 and RĢ2. If
the serial correlation is due to spurious regression āwhich means fyt g and
some of the explanatory variables have unit roots āthen R2 and RĢ2 are
pretty useless.
But if the data are weakly dependent (perhaps after diĀ¤erencing or using
growth rates), the usual R-squareds are reliable even if there is serial
correlation (and/or heteroskedasticity).
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 5 / 28
6. 2. Computing Standard Errors Robust to Serial Correlation and
Heteroskedasticity
It is increasingly common to treat serial correlation in TS regression like
we often treat heteroskedasticity in CS regression: as a nuisance that
causes the usual inference to be incorrect.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 6 / 28
7. For heteroskedasticity, we make inference robust to heteroskedasticity of
unknown form:
reg y x1 x2 ... xk, robust
Importantly, if we can rule out serial correlation in the errors, we can use
exactly the same command to make inference robust to heteroskedasticity
with time series.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 7 / 28
8. It is also possible to compute standard errors, CIs, and test statistics
robust to general forms of serial correlation āat least approximately.
These statistics are also robust to any kind of heteroskedasticity.
The underlying theory is complicated, but it is easy to describe the idea.
For example, we might decide up front to allow ut to be correlated with
ut 1 and ut 2, but not the errors more than two periods apart. See
Wooldridge (5e, Section 12.5) for details.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 8 / 28
9. The resulting standard errors are usually called Newey-West standard
errors, and are now computed routinely by Stata and other programs.
The standard errors are sometimes called HAC (heteroskedasticity
and autocorrelation consistent) standard errors.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 9 / 28
10. The N-W standard errors are not as automated as the adjustment for
heteroskedasticity because we have to choose a lag. With annual data, the
lag is usually fairly short āmaybe a couple of years, so lag = 2 ābut with
quarterly or monthly data we tend to try longer lags, such as lag = 24.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 10 / 28
11. The command in Stata is
newey y x1 x2 ... xk, lag(q)
where we have to choose q, and probably will experiment a bit to see how
sensitive the standard errors are. If we choose q = 0, it is the same thing
as
reg y x1 x2 ... xk, robust
Important: We are still estimating the parameters by OLS. We are only
changing how we estimate their precision and peform inference.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 11 / 28
12. Just as with the heteroskedasticity-robust inference, we can apply the
HAC inference whether or not we have evidence of serial correlation. Large
diĀ¤erences in the HAC standard errors and the usual ones suggests serial
correlation (autocorrelation) or heteroskedasticity are problems.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 12 / 28
13. EXAMPLE: Estimating a Simple Reaction Function for the Federal Funds
Rate (FEDFUND.DTA)
We earlier found evidence that Ā¤ratet is highly persistent. So are
inā”ation and the GDP gap. So we use changes (diĀ¤erences) of all variables.
With quarterly data, try FDLs of order 4 in both inf and gdpgap.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 13 / 28
14. The usual t statistics show signiā¦cance of both contemporaneous
variables and some lags.
If we try the Newey-West standard errors with lag = 2, the standard
errors generally increase, sometimes by large amounts. For example, cinf
and cinf _3 have have much smaller t statistics.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 14 / 28
15. Increasing the N-W lag to four does not change much.
The joint test of the fourth lags fails to reject, so we would be justiā¦ed
in dropping them.
Overall, there seems to be evidence that the Fed increases the FF rate,
phased over a couple of quarters, when inā”ation increases or when the
GDP gap increases (so actual GDP is above the ideal GDP).
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 15 / 28
20. 3. Testing for Serial Correlation
We specify simple alternative models that allow the errors to be serially
correlated, and then use the model to test the null that the errors are not
serially correlated.
The most common is an AR(1) model:
ut = Ļut 1 + et
where fet g is serially uncorrelated, has a zero mean, and (usually) a
constant variance.
Then the null is
H0 : Ļ = 0
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 16 / 28
21. Often Ļ > 0 when there is serial correlation, but we usually use a
two-sided alternative.
If we could observe fut g, we would just estimate a simple AR(1) model
for ut and test Ļ = 0. [Because E(ut ) = 0, this is one case we would not
have to include a constant.]
But we do not observe the errors. Instead, we base a test on the OLS
residuals, uĢt . (Think back to the case of testing for heteroskedasticity,
where we used uĢ2
t in place of u2
t .)
Remember the diĀ¤erence between uĢt and ut : the former depends on the
estimators, Ī²Ģj .
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 17 / 28
22. Strictly Exogenous Regressors
If the fxtj g are strictly exogenous (Assumption TS.3) then we can use a
simple test. In fact, it suĀ¢ ces that
E(ut jxt , xt+1) = 0,
so ut is uncorrelated with regressors in this time period and next time
period.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 18 / 28
23. Testing for Serial Correlation under Strict Exogeneity
1. Estimate the equation
yt = Ī²0 + Ī²1xt1 + ... + Ī²k xtk + ut , t = 1, 2, ..., n
by OLS, and save the residuals, fuĢt : t = 1, 2, ..., ng.
2. Run the AR(1) regression
uĢt on uĢt 1, t = 2, ..., n
It is not necessary to estimate an intercept āafter all, the averages of uĢt
and uĢt 1 are almost zero over t = 2, ..., n ābut it is harmless to do so.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 19 / 28
24. 3. Compute the usual or heteroskedasticity-robust t statistic for ĻĢ, and
carry out the test H0 : Ļ = 0 in the usual way.
The test has large-sample justiā¦cation and tends to work well. It is often
applied to static and FDL models because strict exogeneity can be true.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 20 / 28
25. With large n, we might reject Ļ = 0 even if ĻĢ is āsmall.ā (The test can
have a lot of power with large n.) With small n, we might not reject even
if ĻĢ seems fairly large.
Just as when we test for heteroskedasticity, the null is that everything is
okay. We require the data to tell us, fairly convincingly, that some action
is required.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 21 / 28
26. Another statistic, related to the previous one, is called the
Durbin-Watson statistic. Unless the sample size is small, it has little to
oĀ¤er over the simple regression-based test.
We can easily add lags, too, and then use and F test: for example, we
can regress
uĢt on uĢt 1, uĢt 2, t = 3, ..., n
and test the two lags for joint signiā¦cance (using a usual F statistic or
heteroskedasticity-robust version).
Remember, Stata will automatically set the lags to missing data where
appropriate.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 22 / 28
27. Conemporaneously Exogenous Regressors
A simple adjustment is needed if the regressors are not strictly
exogenous. All we have to do is add all of the explanatory variables along
with the lagged OLS residual. And, we deā¦nitely estimate an intercept.
So, for the AR(1) test, after getting the OLS residuals exactly as before,
run
uĢt on uĢt 1, xt1, xt2, ..., xtk , t = 2, ..., n
If we take the ā^ā oĀ¤ of the residuals, we can see why we need to
include the regressors: ut 1 might be correlated with xt1, ..., xtk if the xtj
are not strictly exogenous.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 23 / 28
28. This form of the test is more general than the previous form, even
though the previous test is somewhat more popular.
One must use the extended form if one or more of the xtj is a lag of yt ,
but it is needed in other situations where strict exogeneity is violated.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 24 / 28
29. EXAMPLE: Percent Fatalities and TraĀ¢ c Laws (TRAFFIC.DTA)
Use as the dependent variable prcfat, the percent of accidents resulting
in at least one fatality.
The estimate of Ļ is about .282, and the test that assumes strict
exogeneity gives ĻĻĢ = 2.98. So we ā¦nd strong evidence of serial
correlation, although it is not a huge amount of serial correlation.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 25 / 28
30. The more general test gives practically the same results: ĻĻĢ = 2.77.
We can conclude that we should compute Newey-West standard errors,
but it is not clear what the lag should be in N-W.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 26 / 28
31. Using lag = 4 reduces the statistical signiā¦cance of spdlaw and beltlaw,
making beltlaw very insigniā¦cant. spdlaw is still signiā¦cant at the 1.3%
level.
The estimated eĀ¤ect of increasing the speed limit, .067, may seem small.
But the average fatality rate is about .886 with standard deviation = .10.
So, increasing the speed limit (on rural interstates) was associated with
about two-thirds of a standard deviation increase the fatality rate.
The seatbelt law had a negative sign but is not statistically signicant.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 27 / 28
35. . newey prcfat spdlaw beltlaw unem feb-dec t, lag(4)
Regression with Newey-West standard errors Number of obs = 108
maximum lag: 4 F( 15, 92) = 19.74
Prob > F = 0.0000
------------------------------------------------------------------------------
| Newey-West
prcfat | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
spdlaw | .0671634 .0264891 2.54 0.013 .0145538 .1197729
beltlaw | -.0295827 .0330354 -0.90 0.373 -.0951939 .0360284
unem | -.0154371 .0059803 -2.58 0.011 -.0273144 -.0035598
feb | -.0001812 .016465 -0.01 0.991 -.0328821 .0325197
mar | -.0002591 .0225929 -0.01 0.991 -.0451304 .0446123
apr | .057726 .0265662 2.17 0.032 .0049632 .1104888
may | .0714815 .0283569 2.52 0.013 .0151622 .1278008
jun | .1006207 .0319548 3.15 0.002 .0371557 .1640858
jul | .1764641 .0349275 5.05 0.000 .1070951 .2458331
aug | .1924577 .0252154 7.63 0.000 .1423777 .2425377
sep | .1594422 .0292946 5.44 0.000 .1012606 .2176239
oct | .1008793 .0306156 3.30 0.001 .0400742 .1616844
nov | .0133768 .029876 0.45 0.655 -.0459594 .0727131
dec | .0089053 .0283141 0.31 0.754 -.0473291 .0651396
t | -.0022355 .0005551 -4.03 0.000 -.0033381 -.001133
_cons | 1.038472 .0591372 17.56 0.000 .9210202 1.155924
------------------------------------------------------------------------------
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 27 / 28
36. EXAMPLE: Serial Correlation in the Federal Funds Rate Equation
No evidence of ā¦rst-order serial correlation, but there is second order
serial correlation.
The standard errors that are robust to heteroskedasticity are actually
larger than those robust to serial correlation and heteroskedasticity.
Sheng-Kai Chang (NTU) Econ 2015 Time Series: Serial Correlation Spring 2016 28 / 28