Autocorrelation in Time Series
See how errors that carry over from one period to the next make standard errors too small, and how to detect and fix it.
Key takeaways
- Autocorrelation means the error in one period is related to the error in nearby periods.
- It is common in time series, where shocks fade slowly.
- With positive autocorrelation, the usual standard errors are too small, so t statistics look better than they are.
- The Durbin–Watson statistic is a quick check: near 2 is fine, near 0 signals positive autocorrelation.
- Fixes include robust (Newey–West) standard errors, adding lagged variables, and rechecking the model's form.
Think about the weather. If today is warmer than the usual forecast for this time of year, tomorrow is probably warmer than the forecast too. A heat wave does not switch off at midnight. Surprises in the weather come in streaks.
Now think about a snow shovel store, tracked month by month. A big snowstorm in January pushes January sales above what any simple model predicted. The storm's effects (people still shoveling, stores out of stock, word of mouth) spill into February, so February also beats the model. The error in one month is linked to the error in the next.
Regression assumes the errors are independent: knowing last month's miss tells you nothing about this month's. With data collected over time, that assumption often fails. The failure is called autocorrelation (or serial correlation), and ignoring it makes your results look far more certain than they deserve to be. This lesson shows what it is, how to spot it with a quick number and a plot, and how to repair the damage.
A picture of streaks
Suppose we fit a straight-line trend to ten months of the shovel store's sales. The line is fitted sales, and the dots are what actually happened.
Months 1 to 4 sit above the line, months 5 to 8 below, then months 9 and 10 above again.
Look at who sits where. The first four dots are above the line, the next four are below, and the last two are above. If errors were independent, the dots would bounce randomly across the line, with no long runs of the same side. The long runs are the signature of positive autocorrelation: a positive miss tends to be followed by a positive miss, and a negative miss by a negative one.
Less common is negative autocorrelation, where misses alternate: above, below, above, below. It can arise, for example, when a store over-orders after a shortage and then under-orders. We will focus on the positive kind, which is typical in economic time series.
A common way to write the simplest pattern is the first-order autoregressive error:
e(t) = ρ × e(t−1) + u(t) Here e(t) is the error in period t, u(t) is a fresh random shock that is independent over time, and ρ (the Greek letter rho) is a number between −1 and 1 that tells you how strongly last period's error carries over. If ρ = 0.6, then 60% of last period's error shows up again this period, plus a new surprise. If ρ = 0, errors are independent.
What it does to your results
As with the lesson on heteroskedasticity, the news is mixed. When the model has only ordinary explanatory variables, the coefficients remain unbiased. What breaks is the standard errors.
Here is why positive autocorrelation makes them too small. If errors come in streaks, the 40 monthly observations contain less independent information than 40 independent observations would. A streak of four high months is closer to "one piece of news" than to "four pieces of news." The ordinary formula counts each month as a fresh piece, so it thinks it knows more than it does and reports standard errors that are too small. The t statistics come out too large, and you may announce results that are mostly luck.
Suppose a coefficient on advertising is 0.8 with an ordinary standard error of 0.3. The t statistic is 0.8 ÷ 0.3 = 2.67, which looks significant. If the corrected standard error is 0.5, the t statistic is 0.8 ÷ 0.5 = 1.6, which does not clear the usual cutoff near 2. The same data, a different story.
Two further effects are worth knowing. First, the usual estimator is no longer the most efficient, since the pattern in the errors contains information you could exploit. Second, in models that include a lagged value of the outcome as an explanatory variable, autocorrelation can make the coefficients biased too, not just the standard errors. That case needs more care than we give it here.
Detecting it
Look at the residuals over time. Plot them in date order. Long runs of the same sign suggest positive autocorrelation. A zigzag suggests negative.
Compute the Durbin–Watson statistic. Named after the two statisticians who proposed it, the DW statistic is built from the residuals e(1), e(2), ..., e(n):
DW = Σ [e(t) − e(t−1)]² ÷ Σ e(t)² The top adds up squared changes from one period to the next. The bottom adds up squared residuals. If the residuals are streaky, neighboring values are similar, so the changes are small and DW is small. A useful approximation is DW ≈ 2 × (1 − ρ̂), where ρ̂ is the estimated carry-over.
No autocorrelation gives DW near 2. Strong positive autocorrelation pushes it toward 0. Strong negative pushes it toward 4.
Here is a small example. Suppose a regression leaves these ten residuals, in order: 1, 2, 2, 1, −1, −2, −2, −1, 1, −1. They sum to zero, as OLS residuals do.
Bottom: squares are 1, 4, 4, 1, 1, 4, 4, 1, 1, 1, which add up to 22.
Top: changes from one month to the next are 1, 0, −1, −2, −1, 0, 1, 2, −2. Squares are 1, 0, 1, 4, 1, 0, 1, 4, 4, which add up to 16.
DW = 16 ÷ 22 ≈ 0.73. Then ρ̂ ≈ 1 − 0.73 ÷ 2 ≈ 0.64. That is well below 2, matching the long runs we can see in the list. The residuals say: strong positive autocorrelation.
From the approximation DW ≈ 2 × (1 − ρ). Compare your computed value with these. Hypothetical example: the numbers are made up to show the method, not a quote or an average.
The exact cutoffs for "too low" depend on the sample size and number of variables, and come from published tables or from the software. Roughly, values well below 2 (say under 1.5 in a moderate sample) are worth worrying about. The Durbin–Watson test only looks at neighboring periods and can be misled when the model includes a lagged outcome. A broader check, the Breusch–Godfrey test, handles longer patterns and lagged outcomes; your software will offer it.
Fixing it
Newey–West standard errors. Like the robust errors in the previous lesson, these leave the coefficients alone and fix only the standard errors, this time allowing the errors to be linked across a stretch of nearby periods. They are also called HAC errors, short for heteroskedasticity and autocorrelation consistent. This is the most common practical fix. You choose how many lags to allow; software has default rules, and it is wise to check that conclusions do not change much with the choice.
Add the missing dynamics. Often autocorrelation is a symptom of a model that has left something out. The shovel store's sales may depend on last month's sales or on a seasonal pattern the trend line misses. Add a lagged variable, seasonal dummies (see the dummy variable lesson) or a better trend, then recheck the residuals. A curve that bends can produce streaky misses from a straight line. The functional form lesson helps here.
Transform the data. Methods such as Cochrane–Orcutt and generalized least squares subtract a share ρ of last period's values from each variable before running the regression, so the errors become independent. These can be more precise than OLS when the error pattern is modeled correctly, but they depend on getting the pattern right.
Use changes instead of levels. Differencing, which means working with this month's change in sales instead of the level, removes slow-moving trends and shrinks autocorrelation. It also changes the question you answer, so use it on purpose.
A warning about trending data
Two series that both trend upward, such as a country's cheese consumption and its number of engineering degrees, will show a high R² in a regression even if they have nothing to do with each other. The residuals from such a regression usually show extreme autocorrelation, with a Durbin–Watson statistic near zero. This is called spurious regression. A high R² with a very low DW is a classic warning sign. The cure involves methods for time series beyond this course, but the lesson is immediate: if your fit looks too good and your residuals are streaky, be suspicious. This is the old problem of correlation versus cause in a new costume.
Common mistakes
Treating a trend as a cause. Regressing one trending variable on another proves little.
Reading DW as a yes-or-no switch. It is a measure of degree. A value of 1.9 versus 2.1 means nothing; 0.7 means a lot.
Fixing the errors but ignoring the model. Newey–West errors repair the uncertainty measure. If autocorrelation reflects a missing variable, the coefficients may be biased by the omission (see the omitted variable bias lesson), and no standard error fix helps.
Using time series tools on cross-section data. The Durbin–Watson statistic depends on the order of the observations. If your data are a list of households in random order, the order means nothing.
Words to know
Autocorrelation the situation where errors in one period are related to errors in other periods.
Serial correlation another name for autocorrelation.
First-order autoregressive error an error pattern in which each period's error equals ρ times last period's error plus a new shock.
Durbin–Watson statistic a number between 0 and 4 that is near 2 when neighboring residuals are unrelated.
Newey–West standard errors standard errors that stay valid when errors are autocorrelated and have uneven scatter.
Differencing working with period-to-period changes instead of levels.
Spurious regression a regression of unrelated trending series that shows a strong fit by accident.
Check yourself
- What does it mean for errors to be positively autocorrelated?
- Why do t statistics tend to be too large when errors are positively autocorrelated?
- A regression has estimated carry-over ρ̂ = 0.4. Use the approximation to estimate the Durbin–Watson statistic.
- Residuals in order are 1, −1, 1, −1, 1, −1 (six periods). Compute the Durbin–Watson statistic and say what kind of autocorrelation this suggests.
- A coefficient is 1.2 with ordinary standard error 0.4 and Newey–West standard error 0.8. Compute both t statistics.
- Name two ways to respond to autocorrelation and say how they differ.
Show the answers
- A positive miss tends to follow a positive miss, and a negative miss follows a negative one, so errors come in streaks.
- Streaky errors carry less independent information than the formula assumes, so standard errors come out too small and t statistics too large.
- DW ≈ 2 × (1 − 0.4) = 2 × 0.6 = 1.2.
- Bottom: six squares of 1 give 6. Top: five changes of ±2, each squared to 4, give 20. DW = 20 ÷ 6 ≈ 3.33, which suggests negative autocorrelation (a zigzag).
- Ordinary: 1.2 ÷ 0.4 = 3.0. Newey–West: 1.2 ÷ 0.8 = 1.5, which no longer clears the usual cutoff near 2.
- Newey–West errors keep the coefficients and fix only the standard errors; adding lags or seasonal terms changes the model itself, which can fix the cause if something was left out.