Durbin Watson Test Calculator

Measure correlation in errors with Durbin Watson score. Enter residuals, see charts, and compare scenarios. Download CSV or PDF, and keep results organized easily.

Choose how you want to provide data.
Controls rounding in results and tables.
Used for reporting. Bounds depend on n and k.
Lower bound from a DW table.
Upper bound from a DW table.
If omitted, rows use 1..n.
Useful if residuals are not mean-zero.
Durbin Watson uses residuals ordered in time.
Same length as predicted.
Residuals computed as y − ŷ.

Example data table

This sample uses actual and predicted values, then computes residuals and DW.

t Actual Predicted Residual
1 120 118 2
2 132 130 2
3 128 129 -1
4 140 141 -1
5 138 137 1
6 150 148 2
7 149 151 -2
8 160 159 1
Sample DW ≈ 1.9500 (computed from residuals).

Formula used

The Durbin Watson statistic checks first-order autocorrelation in regression residuals.

DW = \(\dfrac{\sum_{t=2}^{n}(e_t - e_{t-1})^2}{\sum_{t=1}^{n} e_t^2}\)
Here, et is the residual at time t, and n is the number of residuals.

A handy approximation for the lag-1 correlation is \(\rho \approx 1 - DW/2\).

How to use this calculator

  1. Choose an input method: residuals, or actual and predicted.
  2. Paste numbers in order (earliest to latest).
  3. Optionally enter dL and dU from a reference table.
  4. Click Calculate to see DW, charts, and the step table.
  5. Use Download CSV or Download PDF to save results.

Notes on interpretation

  • DW ≈ 2 suggests no first-order autocorrelation.
  • DW < 2 often indicates positive autocorrelation.
  • DW > 2 often indicates negative autocorrelation.
  • The formal decision uses dL and dU based on n, predictors, and alpha.
  • Autocorrelation can be addressed with better model structure or robust errors.

Regression diagnostics that flag serial correlation

Durbin Watson evaluates whether regression errors move together across time. In many forecasting datasets, residuals are ordered by date, hour, or batch. A DW near 2.00 supports independence, while values below 1.50 often signal persistence. This calculator accepts n ≥ 3 and reports numerator and denominator so you can audit every step carefully.

DW scale and rho approximation

The statistic ranges from 0 to 4. When DW = 2.00, the lag‑1 correlation is roughly ρ ≈ 0. When DW = 1.20, ρ ≈ 0.40, suggesting positive dependence. When DW = 2.80, ρ ≈ −0.40, suggesting negative dependence. Use the approximation as a quick check, not a substitute for formal bounds.

Data entry quality and reporting

You can paste residuals directly, or paste actual and predicted values and let residuals compute as y − ŷ. Optional centering subtracts the residual mean to reduce drift. Select 2–8 decimals to match your reporting standard. After calculation, export a CSV for rows and a PDF report for audits.

Bounds dL and dU with clear decision regions

If you have table values, enter dL and dU to classify results using textbook regions. Example: with dL = 1.10 and dU = 1.54, a DW of 1.05 indicates positive autocorrelation. A DW of 1.30 is inconclusive, and a DW between 1.54 and 2.46 suggests no first‑order autocorrelation. For negative correlation, compare against 4−dU and 4−dL: DW above 4−dL indicates negative autocorrelation, while 4−dU to 4−dL is inconclusive. Keep k and n consistent with the table used.

Visual checks from Plotly charts

The residual series plot highlights runs above or below zero, level shifts, and variance changes. The lag‑1 scatter plots e_t against e_{t−1}. A tight upward cloud implies positive autocorrelation, while a downward cloud suggests negative. Random scatter around the origin aligns with DW near 2.

Actions when autocorrelation appears

Low DW values commonly occur when key lags or seasonal effects are missing. Consider adding lagged predictors, differencing, or seasonal terms. If the model form is fixed, use robust standard errors such as HAC methods. Recompute DW after changes and compare exports to document improvement over versions.

FAQs

1) What does a Durbin Watson value near 2 mean?

A value close to 2 indicates little evidence of first‑order autocorrelation in residuals. Your error terms behave more like independent noise, which supports standard regression inference under typical OLS assumptions.

2) Why can my DW be below 1?

DW below 1 suggests strong positive autocorrelation, often caused by missing lagged variables, trends, or seasonality. It can also appear when residuals are not ordered correctly in time.

3) Do I need dL and dU to use this calculator?

No. The calculator always computes DW and an approximate ρ. If you supply dL and dU from a reference table that matches your n and predictors, it also provides a bounds‑based decision.

4) Should I center residuals before calculating?

Centering subtracts the residual mean and can reduce drift if residuals are not mean‑zero. It usually does not change conclusions when residuals already average near zero, but it can improve numerical stability.

5) Can I input actual and predicted values instead of residuals?

Yes. Select the Actual & Predicted method, paste y and ŷ in the same order, and the tool computes residuals as y − ŷ automatically before calculating the statistic and charts.

6) What should I do if DW indicates autocorrelation?

Consider adding lagged predictors, seasonal terms, or differencing. If the model form is fixed, use robust standard errors (HAC) and compare DW again after changes to document improvements.

Related Calculators

Linear Regression CalculatorMultiple Regression CalculatorSimple Regression CalculatorPower Regression CalculatorLogarithmic Regression CalculatorR Squared CalculatorSlope Intercept CalculatorCorrelation Coefficient CalculatorSpearman Correlation CalculatorResiduals Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.