Durbin Watson Statistic

Updated: October 4, 2025

What is the Durbin–Watson (DW) statistic?
The Durbin–Watson statistic is a diagnostic used after an ordinary least squares (OLS) regression to detect first‑order autocorrelation (serial correlation at lag 1) in the model residuals. Its value ranges from 0 to 4:
– About 2.0 → little or no first‑order autocorrelation.
– Less than 2 → positive autocorrelation (residuals tend to have the same sign in consecutive observations).
– Greater than 2 → negative autocorrelation (residuals tend to switch sign consecutively).

Key takeaway
– DW tests for correlation between adjacent residuals. Serial correlation violates an OLS assumption and can bias standard errors and inference. Use DW as a quick diagnostic; if there is evidence of autocorrelation, address it with appropriate model changes or robust inference methods.

Formula and intuition
– Exact formula:
DW = sum_{t=2}^T (e_t − e_{t−1})^2 / sum_{t=1}^T e_t^2
where e_t are the residuals from your fitted OLS model and T is the number of observations.
– Relation to the estimated lag‑1 autocorrelation ρ̂:
DW ≈ 2(1 − ρ̂). So DW near 2 means ρ̂ ≈ 0; DW 0 (positive autocorr); DW > 2 implies ρ̂ < 0 (negative autocorr).

When to use — and when not to
– Appropriate: cross‑sectional data with residuals ordered in time or space where first‑order serial correlation is a concern; time‑series OLS regressions where no lagged dependent variable is included among regressors.
– Not appropriate: models that include a lagged dependent variable among regressors (Durbin–Watson statistic is not valid in that case). Use alternatives such as the Durbin h test, the Breusch–Godfrey test, or Ljung–Box tests when higher‑order serial correlation might exist.
– Small sample caution: DW decision requires lookup of lower/upper bounds (dL, dU) in DW tables for formal hypothesis testing; with small n or many regressors, interpret rule‑of‑thumb ranges (e.g., 1.5–2.5) cautiously.

Practical step‑by‑step guide to computing and interpreting DW
1. Fit the OLS regression and save residuals e1, e2, …, eT.
2. Compute numerator = sum_{t=2}^T (e_t − e_{t−1})^2.
3. Compute denominator = sum_{t=1}^T e_t^2.
4. Compute DW = numerator / denominator.
5. Quick interpretation:
– DW ≈ 2 → no evidence of first‑order autocorrelation.
– DW 2 → evidence of negative autocorrelation.
For formal inference, compare DW to published dL and dU bounds (or use p‑values from more general tests like Breusch–Godfrey).
6. If autocorrelation is present, consider remedies (see below).

Remedies and alternatives if autocorrelation is detected
– Re‑specify the model: add relevant lagged explanatory variables or include AR terms for the error process (e.g., model errors as AR(1)).
– Use time‑series techniques: ARIMA, state‑space models, or dynamic panel techniques.
– Use feasible generalized least squares (FGLS) methods such as Cochrane–Orcutt or Prais–Winsten to correct for AR(1) errors.
– Use robust standard errors: Newey‑West (HAC) standard errors give consistent inference in presence of autocorrelation and heteroskedasticity.
– Use alternative tests: Breusch–Godfrey test (allows testing for higher‑order serial correlation and works with lagged dependent vars), Ljung–Box (portmanteau) test for autocorrelation across multiple lags.

Worked example (from the provided dataset)
Data pairs (x,y): (10,1100), (20,1200), (35,985), (40,750), (50,1215), (45,1000).
OLS best‑fit line (given): Y = −2.6268 x + 1,129.2.

Residuals (observed − fitted):
– e1 = −2.9
– e2 = 123.3
– e3 = −52.3
– e4 = −274.1
– e5 = 217.1
– e6 = −11

Compute DW:
– Numerator = Σ_{t=2..6} (e_t − e_{t−1})^2 = 389,264.09
– Denominator = Σ_{t=1..6} e_t^2 = 140,330.81
– DW = 389,264.09 / 140,330.81 ≈ 2.774

Interpretation for this example:
– DW ≈ 2.77 (>2) indicates evidence of negative first‑order autocorrelation in residuals (consecutive residuals tend to have opposite signs).
– Using the relation DW ≈ 2(1 − ρ̂) yields ρ̂ ≈ 1 − DW/2 ≈ −0.387, consistent with a moderately negative lag‑1 residual autocorrelation.
– Caveat: the sample is very small (T = 6). For formal testing you should consult DW bounds for given n and number of regressors or prefer a Breusch–Godfrey test or bootstrap/HAC inference.

Software and automation
– Most statistical packages (R, Stata, Python statsmodels, EViews, SAS, SPSS) return the DW statistic as part of regression output or offer easy functions to compute it.
– For models with lagged dependent variables or higher‑order autocorrelation, use functions for Breusch–Godfrey, Ljung–Box, or estimate ARIMA/GARCH models directly.

Summary checklist (practical)
– After OLS, always inspect residuals (plot vs time, ACF/PACF).
– Calculate DW (or have software do it).
– If DW deviates noticeably from 2, corroborate with ACF plot and Breusch–Godfrey test.
– If autocorrelation is present, either model the serial correlation explicitly (AR terms, ARIMA) or use robust inference (Newey‑West) / GLS methods.

Source
– Investopedia: “Durbin Watson Statistic” (Joules Garcia). Original article used as a source for exposition and example: https://www.investopedia.com/terms/d/durbin-watson-statistic.asp

If you’d like, I can:
– compute formal DW bounds (dL, dU) for the example given n and number of regressors,
– show step‑by‑step code in R or Python statsmodels to compute DW and Breusch–Godfrey, or
– demonstrate remedies (e.g., Cochrane–Orcutt or Newey‑West) on this dataset. Which would you prefer?