- The Durbin–Watson test checks the residuals of a time-series regression for first-order autocorrelation: is this period’s error related to last period’s?
- The statistic \( d \) runs from 0 to 4, and \( d \approx 2(1-\hat{\rho}) \). Near 2: no autocorrelation. Towards 0: positive. Towards 4: negative.
- Compare \( d \) with the bounds \( d_L \) and \( d_U \) from a table, or better, use the exact \( p \)-value that R and other software can compute.
- Worked example: a consumption function with \( d = 1.509 \). The bounds test is inconclusive, but the exact \( p \)-value is 0.018, so we reject “no autocorrelation”.
- Do not use Durbin–Watson with a lagged dependent variable, and do not trust the “1.5 to 2.5 is fine” rule of thumb. Use the Breusch–Godfrey test as well.
The Durbin–Watson test is the autocorrelation check that almost every regression package prints, and one of the most often misread numbers in regression output. This guide explains what the Durbin–Watson statistic measures, how to run the test in Python, R, Stata, SPSS and Excel, how to use the \( d_L \) and \( d_U \) bounds, what to do when the result is inconclusive, and when the test should not be used at all. Every number comes from a worked example with real software output.
What autocorrelation is, and why it matters
In time-series data the error in one period is often related to the error in the next. A burst of consumer optimism that pushes spending above its usual relationship with income this year tends to fade gradually rather than vanish overnight. The simplest model of this is the first-order autoregressive, AR(1), error:
Why care? Under the usual assumptions OLS is still unbiased when the errors are autocorrelated, but its standard errors are wrong. With positive autocorrelation and trending regressors they are usually too small, so \( t \) statistics are too large and confidence intervals too narrow: you find “significant” effects that are not there. The exception is a model with a lagged dependent variable, where autocorrelated errors make OLS itself biased. The same problem in cross-sections, with unequal error variances instead of correlated errors, is heteroskedasticity.
Autocorrelation, its tests and its remedies take up Chapter 12 of the Econometrics Made Simple textbook, which supplies the data used below.
The Durbin–Watson statistic
Durbin and Watson (1950, 1951) proposed a statistic built from the OLS residuals \( \hat{u}_t \):[1]
The numerator adds up the squared changes in the residuals; the denominator is the residual sum of squares. To see the approximation, expand the square: \( \sum(\hat{u}_t-\hat{u}_{t-1})^2 \) \( = \sum\hat{u}_t^2 + \sum\hat{u}_{t-1}^2-2\sum\hat{u}_t\hat{u}_{t-1} \). The first two sums are each almost equal to the denominator, and the cross-product divided by the denominator is roughly \( \hat{\rho} \), the first-order autocorrelation of the residuals.
| Value of \( d \) | Implied \( \hat{\rho} \) | What it suggests |
|---|---|---|
| Close to 0 | Close to +1 | Strong positive autocorrelation: long runs of residuals with the same sign |
| Around 2 | Around 0 | No first-order autocorrelation |
| Close to 4 | Close to −1 | Strong negative autocorrelation: residuals zig-zag |
So \( d \) always lies between 0 and 4, and the question is how far from 2 it has to be before we conclude that the errors really are autocorrelated rather than just by chance.
Worked example: a consumption function
The file consumption.csv from Econometrics Made Simple, Chapter 12, has annual data for 1975–2024 (\( T = 50 \)) on real consumption, disposable income and household wealth per person, and a real interest rate. The data are simulated, and we know that the errors were generated as AR(1) with \( \rho = 0.55 \), so we can see whether the tests find what is there. The model is
OLS gives an income coefficient of 0.698 with \( R^2 = 0.9985 \). Now the residuals.
Compute the Durbin–Watson statistic for the consumption function, the implied \( \hat{\rho} \), and test for positive autocorrelation at the 5% level.
The table cannot decide. Software can: see the exact \( p \)-value below.
Reading the bounds: the decision rule
The exact distribution of \( d \) depends on the particular values of the regressors, so Durbin and Watson could only tabulate a lower bound \( d_L \) and an upper bound \( d_U \) for each sample size \( T \) and number of regressors \( k’ \).[2] For \( H_1\!: \rho > 0 \):
- \( d < d_L \): reject \( H_0 \), evidence of positive autocorrelation;
- \( d > d_U \): do not reject \( H_0 \);
- \( d_L \le d \le d_U \): inconclusive.
For negative autocorrelation, apply the same rule to \( 4-d \). Figure 2 puts the zones on one scale. Savin and White (1977) extended the tables to very small and very large samples and to many regressors.[3]
The exact p-value
The inconclusive zone is a relic of the days of printed tables. Given the actual regressors, a computer can work out the exact distribution of \( d \) under \( H_0 \) (assuming normal errors). R’s dwtest does this and reports DW = 1.5086, p-value = 0.01847 for the alternative \( \rho > 0 \). We checked it independently by simulating \( d \) 200,000 times with the same regressors and independent normal errors: 1.8% of the simulated values were at or below 1.509. So at 5% the Durbin–Watson test does detect positive autocorrelation, even though the bounds could not decide.
How to run the Durbin–Watson test
import pandas as pd
import statsmodels.formula.api as smf
from statsmodels.stats.stattools import durbin_watson
from statsmodels.stats.diagnostic import acorr_breusch_godfrey
cons = pd.read_csv("consumption.csv")
m = smf.ols("consumption ~ income + wealth + interest_rate", data=cons).fit()
print(durbin_watson(m.resid)) # 1.5086 (also shown in m.summary())
print(acorr_breusch_godfrey(m, nlags=2)) # LM = 7.825, p = 0.020
Python prints \( d \) at the foot of every summary() but gives no \( p \)-value. Compare it with the bounds, or use R.
library(lmtest)
cons <- read.csv("consumption.csv")
model <- lm(consumption ~ income + wealth + interest_rate, data = cons)
dwtest(model) # DW = 1.5086, p-value = 0.01847
bgtest(model, order = 2) # LM test = 7.8253, df = 2, p-value = 0.01999
import delimited using "consumption.csv", clear
tsset year
regress consumption income wealth interest_rate
estat dwatson // Durbin-Watson d
estat durbinalt // Durbin's alternative test
estat bgodfrey, lags(1 2 3) // Breusch-Godfrey
SPSS: Analyze → Regression → Linear → Statistics, tick Durbin-Watson; the value appears in the Model Summary table. EViews prints “Durbin-Watson stat” under every least-squares estimate. Excel has no built-in test, but with the residuals in A2:A51 this formula gives \( d \):
=SUMXMY2(A3:A51,A2:A50)/SUMSQ(A2:A51)
In all of these, the data must be sorted in time order: \( d \) compares each residual with the one in the row above.
New to reading output? See how to read regression output, which explains where the Durbin–Watson value sits alongside the other statistics.
Limitations of the Durbin–Watson test
The test is still useful as a quick first check, but it has four well-known weaknesses.
- It needs an intercept in the model and regressors that are fixed or strictly exogenous.
- It only tests first-order autocorrelation. Quarterly data often have errors correlated four periods apart, and monthly data twelve; \( d \) can sit near 2 while those patterns are present.
- The inconclusive region, unless you use an exact \( p \)-value.
- It is invalid with a lagged dependent variable. If \( y_{t-1} \) is a regressor, \( d \) is biased towards 2 and tends to miss autocorrelation that is there.
Lagged dependent variables: Durbin’s h
For models with \( y_{t-1} \), Durbin (1970) proposed the \( h \) statistic,[4]
where \( \hat{\alpha} \) is the coefficient on \( y_{t-1} \). Adding lagged consumption and lagged income to our model (\( T = 49 \) usable years) gives \( d = 1.615 \) and \( \text{se}(\hat{\alpha}) = 0.097 \), so \( T\,\widehat{\text{Var}}(\hat{\alpha}) \) \( = 0.463 \) and \( h = 1.84 \), above the one-sided 5% critical value of 1.645 (\( p = 0.033 \)). The \( h \) statistic cannot be computed when \( T\,\widehat{\text{Var}}(\hat{\alpha}) \ge 1 \), which is one reason the next test has largely replaced it. Stata’s estat durbinalt runs Durbin’s alternative, regression-based version.
The Breusch–Godfrey test: the modern alternative
The Breusch–Godfrey LM test regresses the residuals on the original regressors and \( p \) lagged residuals, then uses \( TR^2 \sim \chi^2_p \).[5][6] It allows lagged dependent variables, tests any order of autocorrelation, and has no inconclusive region. For the consumption function:
| Test | Statistic | p-value | Reject at 5%? |
|---|---|---|---|
| Durbin–Watson (exact) | d = 1.509 | 0.018 | Yes |
| Breusch–Godfrey, 1 lag | LM = 2.615 | 0.106 | No |
| Breusch–Godfrey, 2 lags | LM = 7.825 | 0.020 | Yes |
| Breusch–Godfrey, 3 lags | LM = 7.858 | 0.049 | Yes |
The evidence is mixed, and that is typical with 50 observations. Why do the residuals show \( \hat{\rho} \) of only 0.23 when the errors were built with 0.55? Partly sampling error (the standard error of \( \hat{\rho} \) is 0.14), and partly because residuals are not errors: when regressors trend, OLS bends the fitted line towards slow swings in the error, so the residuals look less autocorrelated than the errors are. The lesson: tests for autocorrelation have low power in short samples, and failing to reject is not proof that the errors are uncorrelated.
A real-data warning: very low d and spurious regression
The file us_macro.csv holds real US quarterly data for 1959–2009. Regressing real consumption on real disposable income in levels gives a slope of 0.954 and \( R^2 = 0.9982 \), which looks spectacular. But \( d = 0.253 \), \( \hat{\rho} = 0.869 \) (and \( 2(1-0.869) = 0.262 \)), and the Breusch–Godfrey statistic with four lags is 160.65. The residuals wander away from zero for decades at a time.
Granger and Newbold (1974) showed that regressions between unrelated trending series routinely produce high \( R^2 \), large \( t \) statistics and very low Durbin–Watson values, and suggested a rule of thumb: when \( R^2 > d \), suspect a spurious regression.[7] Here \( 0.998 > 0.253 \). The fix is not a better standard error but a better model: work in growth rates, or test for unit roots and cointegration.
In quarterly growth rates the slope falls to 0.341 and \( d = 1.889 \). With \( T = 202 \) and one regressor, our computed 5% bounds are about 1.76 and 1.78, so the Durbin–Watson test no longer detects first-order autocorrelation. Yet Breusch–Godfrey with four lags still rejects (LM = 20.20, \( p = 0.0005 \)): the remaining autocorrelation is at longer lags, exactly what \( d \) cannot see.
What to do if the test finds autocorrelation
- Re-think the model first. Autocorrelation often signals something missing: a lag of \( y \) or \( x \), a wrong functional form, a trend, or a spurious levels regression.
- Use autocorrelation-robust (Newey–West, HAC) standard errors. They keep the OLS coefficients and fix the standard errors.[8] In the levels regression above the HAC standard error is 2.25 times the usual one (0.00645 against 0.00287). In the consumption function, where \( \hat{\rho} \) is small, the change is slight: income’s standard error goes from 0.0254 to 0.0246.
- Or use feasible GLS (Cochrane–Orcutt or Prais–Winsten), which estimates \( \rho \) and transforms the data. For the consumption function Cochrane–Orcutt estimates \( \hat{\rho} = 0.239 \) and gives an income coefficient of 0.703.
- Re-test with Breusch–Godfrey, never Durbin–Watson, after adding lags of \( y \).
Regression assumptions in general are covered in our guide to OLS assumptions, and panel data, where the same problem appears within each unit, in fixed effects vs random effects.
Practice questions
Use a 5% significance level. Bounds given in a question are 5% bounds for a test against positive autocorrelation.
EasyQ1. A regression has \( d = 0.9 \). What is the approximate first-order autocorrelation of the residuals, and what does it suggest? Show worked answer
Fairly strong positive autocorrelation: residuals tend to come in runs of the same sign.
EasyQ2. Eight consecutive residuals are 2, 3, 1, −1, −2, −1, 1, 2. Compute \( d \). Show worked answer
Sum of squared residuals: \( 4 + 9 + 1 + 1 + 4 + 1 + 1 + 4 \) \( = 25 \).
\( d = 16/25 = 0.64 \), suggesting positive autocorrelation (\( \hat{\rho} \approx 0.68 \)).
MediumQ3. A regression with \( T = 30 \), an intercept and one regressor has \( d_L = 1.352 \) and \( d_U = 1.489 \). State the conclusion if (a) \( d = 1.20 \); (b) \( d = 1.40 \); (c) \( d = 2.70 \). Show worked answer
(b) \( 1.352 \le 1.40 \le 1.489 \): inconclusive. Use an exact \( p \)-value or the Breusch–Godfrey test.
(c) Test for negative autocorrelation using \( 4-d = 1.30 \). Since \( 1.30 < 1.352 \), reject: evidence of negative autocorrelation.
MediumQ4. A model with lagged \( y \) as a regressor is estimated on \( T = 64 \) quarters. It reports \( d = 1.70 \) and a standard error of 0.08 on the lagged \( y \) coefficient. Why is the Durbin–Watson test inappropriate? Compute Durbin’s \( h \) and test for positive autocorrelation. Show worked answer
\( T\,\widehat{\text{Var}} \) \( = 64 \times 0.0064 \) \( = 0.4096 \).
\( h \) \( = (1-0.85)\sqrt{64/(1-0.4096)} \) \( = 0.15 \times \sqrt{108.4} \) \( = 0.15 \times 10.41 \) \( = 1.56 \).
\( 1.56 < 1.645 \) (\( p = 0.059 \)): do not reject at 5%, though it is close. A Breusch–Godfrey test would be a sensible check.
ExamQ5. A student regresses a country’s house prices on its money supply, both in levels, using 60 quarters. She reports \( R^2 = 0.97 \), a \( t \) statistic of 41 and \( d = 0.41 \). For \( T = 60 \) and one regressor, \( d_L \approx 1.55 \). (a) Test for autocorrelation. [2] (b) Estimate \( \rho \). [1] (c) Explain why the \( t \) statistic should not be trusted, and why the results may be spurious. [3] (d) Suggest two better approaches. [2] Show worked answer
(b) \( \hat{\rho} \approx 1-0.41/2 \) \( = 0.80 \) [1].
(c) With strong positive autocorrelation the usual standard errors are far too small, so \( t = 41 \) overstates the precision [1]. Both series trend, and \( R^2 = 0.97 > d = 0.41 \), Granger and Newbold’s warning sign [1]; two unrelated trending series can produce a high \( R^2 \) and large \( t \) [1].
(d) Any two of: estimate the relationship in growth rates or differences; test both series for unit roots and, if both have them, test for cointegration; use HAC standard errors only if the levels relationship is shown to be genuine [2].
Frequently asked questions
What is a good Durbin–Watson value?
A value close to 2 suggests no first-order autocorrelation. Whether a value such as 1.6 is “good enough” depends on the sample size and the number of regressors, so check it against the \( d_L \) and \( d_U \) bounds or an exact \( p \)-value rather than a fixed rule.
What does a Durbin–Watson value above 2 mean?
Values above 2 point towards negative autocorrelation. To test it, compute \( 4-d \) and compare it with the same bounds: if \( 4-d < d_L \), reject \( H_0 \) in favour of negative autocorrelation.
Is a Durbin–Watson value of 0 or 4 possible?
Only in the limit. \( d = 0 \) would mean every residual equals the one before (perfect positive autocorrelation); \( d = 4 \) would mean each residual is exactly minus the previous one.
What do I do if the Durbin–Watson test is inconclusive?
Compute an exact \( p \)-value (R’s dwtest), and run the Breusch–Godfrey test. If the stakes are high, report Newey–West standard errors anyway; they are valid whether or not autocorrelation is present.
Can I use the Durbin–Watson test with a lagged dependent variable?
No. It is biased towards 2 in that case. Use Durbin’s \( h \), Durbin’s alternative test, or, best, the Breusch–Godfrey test.
Does the Durbin–Watson test detect higher-order autocorrelation?
No, only first-order. For seasonal or longer-lag patterns use the Breusch–Godfrey test with several lags or look at the correlogram of the residuals.
Should I use Durbin–Watson for cross-sectional data?
Usually not. Autocorrelation is about ordering in time, and the order of rows in a cross-section is arbitrary, so \( d \) changes if you sort the data differently. Check cross-sections for heteroskedasticity instead.
Studying more than one subject? The Complete Book Bundle has every Economics, Statistics, Mathematics and Econometrics book on the site in one download.
References
- Durbin, J. and Watson, G. S. (1950). Testing for Serial Correlation in Least Squares Regression. I. Biometrika, 37(3/4), 409–428.
- Durbin, J. and Watson, G. S. (1951). Testing for Serial Correlation in Least Squares Regression. II. Biometrika, 38(1/2), 159–178.
- Savin, N. E. and White, K. J. (1977). The Durbin–Watson Test for Serial Correlation with Extreme Sample Sizes or Many Regressors. Econometrica, 45(8), 1989–1996.
- Durbin, J. (1970). Testing for Serial Correlation in Least-Squares Regression When Some of the Regressors are Lagged Dependent Variables. Econometrica, 38(3), 410–421.
- Breusch, T. S. (1978). Testing for Autocorrelation in Dynamic Linear Models. Australian Economic Papers, 17(31), 334–355.
- Godfrey, L. G. (1978). Testing Against General Autoregressive and Moving Average Error Models when the Regressors Include Lagged Dependent Variables. Econometrica, 46(6), 1293–1301.
- Granger, C. W. J. and Newbold, P. (1974). Spurious Regressions in Econometrics. Journal of Econometrics, 2(2), 111–120.
- Newey, W. K. and West, K. D. (1987). A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix. Econometrica, 55(3), 703–708.
- Wooldridge, J. M. (2020). Introductory Econometrics: A Modern Approach, 7th edn, Chapter 12 “Serial Correlation and Heteroskedasticity in Time Series Regressions”. Boston: Cengage Learning.
- The EconTutorials team (2026). Econometrics Made Simple, Chapter 12 “Autocorrelation”, datasets
consumption.csvandus_macro.csv. econtutorials.com.

