Instant PDF download, name-and-email checkout. Complete Book Bundle: every Economics, Statistics, Mathematics and Econometrics book
Econometrics

The Durbin–Watson Test for Autocorrelation: How to Run and Interpret It

The Durbin–Watson test checks regression residuals for first-order autocorrelation. Learn what the d statistic means, how to use the dL and dU bounds and exact p-values, how to run the test in Python, R, Stata, SPSS and Excel, and why it fails with a lagged dependent variable.

In 30 seconds
  • 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:

\[ u_t = \rho\,u_{t-1} + e_t, \qquad -1 < \rho < 1 \]
Key termAutocorrelation (or serial correlation): correlation between the errors of a regression in different time periods. With positive autocorrelation (\( \rho > 0 \)), errors come in runs of the same sign; with negative autocorrelation (\( \rho < 0 \)), they tend to flip sign every period.

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.

Econometrics Made Simple textbook coverChapter 12 of Econometrics Made Simple covers autocorrelation from the AR(1) model to Newey–West standard errors and Cochrane–Orcutt, with Python, R and Stata code.Get the textbook · $15

The Durbin–Watson statistic

Durbin and Watson (1950, 1951) proposed a statistic built from the OLS residuals \( \hat{u}_t \):[1]

\[ d = \frac{\sum_{t=2}^{T}(\hat{u}_t-\hat{u}_{t-1})^2}{\sum_{t=1}^{T}\hat{u}_t^2} \approx 2(1-\hat{\rho}) \]

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 0Close to +1Strong positive autocorrelation: long runs of residuals with the same sign
Around 2Around 0No first-order autocorrelation
Close to 4Close to −1Strong 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

\[ \begin{aligned} \text{cons}_t = {} & \beta_0 + \beta_1\,\text{income}_t \\ & + \beta_2\,\text{wealth}_t + \beta_3\,\text{rate}_t + u_t \end{aligned} \]

OLS gives an income coefficient of 0.698 with \( R^2 = 0.9985 \). Now the residuals.

OLS residuals of the consumption function, 1975–2024
Positive residualNegative residual
−400−200020040019801990200020102020$ per person
Figure 1. Residuals from regressing consumption on income, wealth and the interest rate (consumption.csv, T = 50). Runs such as 1982–83, 2000–01 and 2012–14 show mild positive autocorrelation; the residual changes sign 21 times in 49 years, against about 24.5 for independent errors.
Worked example

Compute the Durbin–Watson statistic for the consumption function, the implied \( \hat{\rho} \), and test for positive autocorrelation at the 5% level.

Step 1From the residuals: \( \sum(\hat{u}_t-\hat{u}_{t-1})^2 \) \( = 1{,}975{,}891 \) and \( \sum\hat{u}_t^2 = 1{,}309{,}756 \).
Step 2\( d \) \( = 1{,}975{,}891/1{,}309{,}756 \) \( = 1.509 \).
Step 3Implied autocorrelation: \( \hat{\rho} \approx 1-d/2 \) \( = 1-0.754 \) \( = 0.25 \). Regressing \( \hat{u}_t \) on \( \hat{u}_{t-1} \) gives 0.226; the approximation is close but not exact in a sample of 50.
Step 4Hypotheses: \( H_0\!: \rho = 0 \) against \( H_1\!: \rho > 0 \). With \( T = 50 \) and \( k’ = 3 \) regressors (excluding the intercept), the 5% bounds are \( d_L = 1.421 \) and \( d_U = 1.674 \).
Step 5\( 1.421 < 1.509 < 1.674 \): \( d \) falls between the bounds, so the bounds test is inconclusive.

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]

Where d = 1.509 falls on the Durbin–Watson scale
Reject:positiveIncon-clusiveDo notreject H₀Incon-clusiveReject:negative← to 0to 4 →1.4211.67422.3262.579d_Ld_Upopular “1.5 to 2.5 is fine” ruleour d = 1.509
Figure 2. 5% decision zones for T = 50 and three regressors plus an intercept (d_L = 1.421, d_U = 1.674); the scale is cut at 1 and 3, and the outer zones continue to 0 and 4. The consumption function’s d = 1.509 lands in the inconclusive zone, and inside the popular 1.5–2.5 “safe” band, yet the exact test rejects (p = 0.018) and the errors were built with ρ = 0.55.

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.

Common mistakeUsing “a Durbin–Watson value between 1.5 and 2.5 is acceptable”. The rule has no fixed basis: the critical values depend on \( T \) and the number of regressors. Here \( d = 1.509 \) passes the rule, yet the exact test rejects at 5% and the true \( \rho \) is 0.55. With \( T = 200 \) and one regressor the 5% lower bound is about 1.76, so a value of 1.6 would be clear evidence of autocorrelation.

How to run the Durbin–Watson test

Python (statsmodels)
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.

R (lmtest)
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
Stata
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.

Econometrics Made Simple Practice Questions coverDurbin–Watson bounds, Breusch–Godfrey and Newey–West: practise them with over 1,150 questions and fully worked answers.Get the practice book · $9

Limitations of the Durbin–Watson test

The test is still useful as a quick first check, but it has four well-known weaknesses.

  1. It needs an intercept in the model and regressors that are fixed or strictly exogenous.
  2. 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.
  3. The inconclusive region, unless you use an exact \( p \)-value.
  4. 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]

\[ h = \left(1-\frac{d}{2}\right)\sqrt{\frac{T}{1-T\,\widehat{\text{Var}}(\hat{\alpha})}} \sim N(0,1) \]

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:

TestStatisticp-valueReject at 5%?
Durbin–Watson (exact)d = 1.5090.018Yes
Breusch–Godfrey, 1 lagLM = 2.6150.106No
Breusch–Godfrey, 2 lagsLM = 7.8250.020Yes
Breusch–Godfrey, 3 lagsLM = 7.8580.049Yes

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

  1. 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.
  2. 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.
  3. 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.
  4. 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
\( \hat{\rho} \approx 1-0.9/2 \) \( = 0.55 \).
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
Changes: 1, −2, −2, −1, 1, 2, 1. Squares sum to \( 1 + 4 + 4 + 1 + 1 + 4 + 1 = 16 \).
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
(a) \( 1.20 < 1.352 \): reject \( H_0 \); evidence of positive autocorrelation (\( \hat{\rho} \approx 0.40 \)).
(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
With a lagged dependent variable, \( d \) is biased towards 2 and the test tends to miss autocorrelation.
\( 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
(a) \( 0.41 < 1.55 \) [1], so reject \( H_0 \): strong positive autocorrelation [1].
(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.

Econometrics Made Simple Complete Bundle coverFrom OLS to autocorrelation and unit roots: get the textbook and the practice book for $19 (was $24).Get the bundle · $19

References

  1. Durbin, J. and Watson, G. S. (1950). Testing for Serial Correlation in Least Squares Regression. I. Biometrika, 37(3/4), 409–428.
  2. Durbin, J. and Watson, G. S. (1951). Testing for Serial Correlation in Least Squares Regression. II. Biometrika, 38(1/2), 159–178.
  3. 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.
  4. 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.
  5. Breusch, T. S. (1978). Testing for Autocorrelation in Dynamic Linear Models. Australian Economic Papers, 17(31), 334–355.
  6. 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.
  7. Granger, C. W. J. and Newbold, P. (1974). Spurious Regressions in Econometrics. Journal of Econometrics, 2(2), 111–120.
  8. Newey, W. K. and West, K. D. (1987). A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix. Econometrica, 55(3), 703–708.
  9. Wooldridge, J. M. (2020). Introductory Econometrics: A Modern Approach, 7th edn, Chapter 12 “Serial Correlation and Heteroskedasticity in Time Series Regressions”. Boston: Cengage Learning.
  10. The EconTutorials team (2026). Econometrics Made Simple, Chapter 12 “Autocorrelation”, datasets consumption.csv and us_macro.csv. econtutorials.com.
Statistics Made Simple Complete Bundle cover showing both the textbook and practice book
Statistics Made Simple covers regression from first principles.Statistics Made Simple Complete Bundle — Textbook + 1,569 Practice Questions
Get it for $16
E

The EconTutorials team writes clear, exam-focused lessons in economics and statistics for A-Level, IB, AP and university students, with more than 13 years of classroom teaching behind every guide and book in the Made Simple series.