Written and maintained by CASRAI Editorial Board
Last updated
The d statistic in this guide is the Durbin-Watson d, the test statistic for first-order autocorrelation in regression residuals (not Cohen’s d, the effect size). Below is a lookup table of its lower and upper critical bounds, dL and dU, at the 5% significance level, followed by the formula, three worked examples and code for Excel, R and Python.
Durbin-Watson d table at the 5% level
Find the row for your sample size n and the column group for K, then compare your computed d with dL and dU. K counts the intercept: a model with two predictors and a constant has K = 3. Bounds are for the one-sided test of positive autocorrelation at the 5% level, rounded here to three decimals.
| n | K = 2 | K = 3 | K = 4 | K = 5 | K = 6 | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| dL | dU | dL | dU | dL | dU | dL | dU | dL | dU | |
| 20 | 1.201 | 1.411 | 1.100 | 1.537 | 0.998 | 1.676 | 0.894 | 1.828 | 0.792 | 1.991 |
| 25 | 1.288 | 1.454 | 1.206 | 1.550 | 1.123 | 1.654 | 1.038 | 1.767 | 0.953 | 1.886 |
| 30 | 1.352 | 1.489 | 1.284 | 1.567 | 1.214 | 1.650 | 1.143 | 1.739 | 1.071 | 1.833 |
| 40 | 1.442 | 1.544 | 1.391 | 1.600 | 1.338 | 1.659 | 1.285 | 1.721 | 1.230 | 1.786 |
| 50 | 1.503 | 1.585 | 1.462 | 1.628 | 1.421 | 1.674 | 1.378 | 1.721 | 1.335 | 1.771 |
| 60 | 1.549 | 1.616 | 1.514 | 1.652 | 1.480 | 1.689 | 1.444 | 1.727 | 1.408 | 1.767 |
| 80 | 1.611 | 1.662 | 1.586 | 1.688 | 1.560 | 1.715 | 1.534 | 1.743 | 1.507 | 1.772 |
| 100 | 1.654 | 1.694 | 1.634 | 1.715 | 1.613 | 1.736 | 1.592 | 1.758 | 1.571 | 1.780 |
Source: the “Critical Values for the Durbin-Watson Test: 5% Significance Level” table (n = 6 to 100, K = 2 to 21, K includes the intercept) as reproduced by the Athens University of Economics and Business (eclass.aueb.gr), checked 29 October 2026. The source gives five decimals; values above are rounded to three. This page shows a selection of sample sizes; the source covers every n from 6 to 100 and K up to 21. Only the 5% level is tabulated here.
How to read dL and dU (and the intercept trap)
Some printed tables index by k’, the number of predictors excluding the intercept. This table indexes by K, which includes it, so K = k’ + 1. Using the wrong column is an easy lookup error: with n = 30, a one-predictor model (k’ = 1, K = 2) has dL = 1.352 and dU = 1.489, while reading the K = 3 column would give 1.284 and 1.567.
For positive autocorrelation (H0: no first-order autocorrelation):
- d < dL: reject H0; evidence of positive autocorrelation.
- d > dU: no evidence of positive autocorrelation.
- dL ≤ d ≤ dU: the test is inconclusive.
For negative autocorrelation, apply the same bounds to 4 − d: reject H0 if 4 − d < dL, and find no evidence if 4 − d > dU. d always falls between 0 and 4, and a value near 2 indicates little first-order autocorrelation.
Formula for d
For regression residuals e1, …, eT in time order:
d = Σt=2..T (et − et−1)² / Σt=1..T et²
The numerator sums squared changes between consecutive residuals; the denominator is the residual sum of squares. Approximately, d ≈ 2(1 − r), where r is the first-order autocorrelation of the residuals, so r = 0 gives d = 2. See the Durbin-Watson test guide for what the test assumes and how to act on a rejection.
Worked example 1: computing d from residuals
Illustrative data, invented to show the arithmetic. Ten residuals in time order: 1.2, 0.8, 0.5, −0.3, −0.9, −1.1, −0.4, 0.2, 0.5, −0.5 (they sum to zero, as OLS residuals with an intercept do).
- Squared successive differences: 0.16, 0.09, 0.64, 0.36, 0.04, 0.49, 0.36, 0.09, 1.00, total 3.23.
- Sum of squared residuals: 5.14.
- d = 3.23 / 5.14 = 0.628.
A d this far below 2 points to positive autocorrelation: neighbouring residuals share a sign in long runs. To test it you would look up dL for your own n and K. This ten-point series is only for the arithmetic; the table above starts at n = 20.
Worked example 2: d lands between dL and dU
Illustrative figures. A regression with two predictors and an intercept (K = 3) on n = 30 observations returns d = 1.45. From the table, dL = 1.284 and dU = 1.567. Because 1.284 ≤ 1.45 ≤ 1.567, the test is inconclusive: neither reject nor accept H0. Common next steps are checking the residual plot, or running a test that returns a p-value (see the code section) rather than relying on the bounds.
Worked example 3: negative autocorrelation via 4 − d
Illustrative figures. A simple regression (one predictor, so K = 2) on n = 50 observations returns d = 2.58. Since d is above 2, test the negative side: 4 − 2.58 = 1.42. The table gives dL = 1.503 and dU = 1.585 for n = 50, K = 2. Because 1.42 < 1.503, reject H0 at the 5% level: the residuals alternate in sign more than chance would suggest.
Compute d in Excel, R and Python
The bounds approach needs the table above; the code below produces d, and the R packages also give a p-value (lmtest::dwtest returns the DW statistic and its p-value; car::durbinWatsonTest computes the statistic with a bootstrapped p-value).
Excel
With residuals in cells B2:B22 (21 values, in time order):
=SUMXMY2(B3:B22,B2:B21)/SUMSQ(B2:B22)
SUMXMY2 sums the squared differences between the two ranges (each residual minus the one before it); SUMSQ is the sum of squared residuals.
R
library(lmtest)
model <- lm(y ~ x1 + x2, data = df)
dwtest(model) # d and a p-value
library(car)
durbinWatsonTest(model) # residual autocorrelation, D-W statistic, bootstrapped p-value
Python
import statsmodels.api as sm
from statsmodels.stats.stattools import durbin_watson
model = sm.OLS(y, sm.add_constant(X)).fit()
d = durbin_watson(model.resid)
The statsmodels documentation (checked 29 October 2026) defines the function as the sum of squared successive residual differences over the sum of squared residuals, always between 0 and 4. It returns d only and does not supply critical values, so compare the result with dL and dU from the table above.
What if d falls between dL and dU?
The inconclusive zone is a limitation of the bounds approach, not a finding. The gap between dL and dU widens as K grows (n = 30: 0.137 at K = 2, 0.762 at K = 6). Use a p-value-based test, or inspect the residuals over time. See autocorrelation in time series data, how to calculate residuals and the assumptions of simple regression for related checks.
Frequently asked questions
What is the d statistic table?
It lists the lower and upper critical bounds, dL and dU, for the Durbin-Watson test at a given significance level, sample size n and number of regressors K. The table above covers the 5% level.
Does a d table statistics lookup need K with or without the intercept?
This table counts the intercept in K, so K = k’ + 1 where k’ is the number of predictors. Other printed tables use k’, so check which convention yours uses.
What does the statsmodels durbin_watson function return?
It returns d, a value always between 0 and 4. The documentation gives no critical values, so compare d with dL and dU from the table.
Is this the same as Cohen’s d?
No. Cohen’s d is an effect size for a difference between means; the Durbin-Watson d tests residual autocorrelation.
Sources
- Athens University of Economics and Business, Critical Values for the Durbin-Watson Test, 5% significance level (table values): https://eclass.aueb.gr/modules/document/file.php/DEOS130/Lab%20material/Statistical_Tables_2A-DW_Table_N%3D6to100_.pdf (checked 29 October 2026)
- statsmodels, durbin_watson: https://www.statsmodels.org/stable/generated/statsmodels.stats.stattools.durbin_watson.html (checked 29 October 2026)
- CRAN, lmtest reference manual (dwtest): https://cran.r-project.org/web/packages/lmtest/refman/lmtest.html (checked 29 October 2026)
- RDocumentation, car::durbinWatsonTest: https://www.rdocumentation.org/packages/car/topics/durbinWatsonTest (checked 29 October 2026)








