# Durbin Watson Test Explained: Autocorrelation in Regression Analysis

![Durbin Watson Test](https://www.investopedia.com/thmb/ZEmsu36exX0SQOCXbEB7NvdFyyI=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/durbin-watson-statistic-4197394-final-1-1598921e038a404aa070411c9ca2cf9f.png)

*— Joules Garcia / Investopedia*

## What Is the Durbin-Watson Statistic?

The Durbin-Watson statistic is a test for [autocorrelation](https://www.investopedia.com/terms/a/autocorrelation.asp) in the residuals of a [regression analysis](https://www.investopedia.com/terms/r/regression.asp). The Durbin-Watson statistic will always have a value ranging between 0 and 4. A value of 2.0 indicates there is no autocorrelation detected in the sample. Values from 0 to less than 2 point to positive autocorrelation, and values from 2 to 4 mean negative autocorrelation.

Positive autocorrelation in a stock means that if the price fell yesterday, it's likely to fall today as well. Negative autocorrelation implies that if a security's price dropped yesterday, it might rise today.

Typically, the Durbin-Watson statistic values that are in the range of 1.5 to 2.5 are considered normal. However, values outside this range could be a cause for concern. While the statistics are used for many regression analysis programs, but is not always suitable in certain situations.  

### Key Takeaways

*   The Durbin-Watson statistic measures the level of autocorrelation in residuals from a regression analysis, with a range from 0 to 4.
*   A Durbin-Watson value close to 2 suggests no autocorrelation; values below 2 indicate positive autocorrelation, and those above 2 signify negative autocorrelation.
*   Autocorrelation can significantly affect statistical analyses by creating misleading interpretations of data trends, especially in time series data like stock prices.
*   The statistic is particularly useful in technical analysis, aiding analysts in understanding the momentum and trends in security prices by recognizing the degree to which past prices affect future movements.
*   The Durbin-Watson test may not be suitable for models that include lagged dependent variables, as it can lead to inappropriate interpretations.

## Exploring the Implications of the Durbin-Watson Statistic

Autocorrelation, also known as [serial correlation](https://www.investopedia.com/terms/s/serial-correlation.asp), can be a significant problem in analyzing historical data if one does not know to look out for it. Since stock prices usually don't change drastically day-to-day, they could be highly correlated even if this provides little useful information. To avoid autocorrelation, you can convert historical prices into daily percentage changes.  

[Technical analysts](https://www.investopedia.com/terms/t/technicalanalysis.asp) use autocorrelation to study price trends using charts instead of focusing on a company’s financial health or management. Technical analysts can use autocorrelation to see how much of an impact past prices for a security have on its future price.

Autocorrelation can reveal a momentum factor in a stock. For example, if you know that a stock historically has a high positive autocorrelation value and you witnessed the stock making solid gains over the past several days, then you might reasonably expect the movements over the upcoming several days (the leading time series) to match those of the lagging time series and to move upward.

> **Fast Fact**
>
> The Durbin-Watson statistic is named after statisticians James Durbin and Geoffrey Watson.

## Key Considerations When Using the Durbin-Watson Test

A rule of thumb is that DW test statistic values in the range of 1.5 to 2.5 are relatively normal. Values outside this range could, however, be a cause for concern. The Durbin-Watson statistic is displayed by many regression analysis programs, but is not applicable in certain situations.

It's inappropriate to use this test if lagged dependent variables are part of the explanatory variables.

## Calculating the Durbin-Watson Statistic: A Step-by-Step Example

The formula for the Durbin-Watson statistic is rather complex but involves the residuals from an ordinary [least squares (OLS) regression](https://www.investopedia.com/terms/l/least-squares-method.asp) on a set of data. The following example illustrates how to calculate this statistic.

Assume the following (x,y) data points:

$\begin{aligned}&\text{Pair One}=(10\text{ and }1100)\\&\text{Pair Two}=(20\text{ and }1200)\\&\text{Pair Three}=(35 \text{ and }985)\\&\text{Pair Four}=(40\text{ and }750)\\&\text{Pair Five}=(50\text{ and }1215)\\&\text{Pair Six}=(45 \text{ and }1000)\end{aligned}$

Using the methods of a least squares regression to find the “[line of best fit](https://www.investopedia.com/terms/l/line-of-best-fit.asp),” the equation for the best fit line of this data is:

$Y={-2.6268}x+{1,129.2}$

This first step in calculating the Durbin-Watson statistic is to calculate the expected “y” values using the line of best fit equation. For this data set, the expected “y” values are:

$\begin{aligned} &\text{Expected}Y\left({1}\right)=\left( -{2.6268}\times{10} \right )+{1,129.2}={1,102.9}\\ &\text{Expected}Y\left({2}\right)=\left( -{2.6268}\times{20} \right )+{1,129.2}={1,076.7}\\ &\text{Expected}Y\left({3}\right)=\left( -{2.6268}\times{35} \right )+{1,129.2}={1,037.3}\\ &\text{Expected}Y\left({4}\right)=\left( -{2.6268}\times{40} \right )+{1,129.2}={1,024.1}\\ &\text{Expected}Y\left({5}\right)=\left( -{2.6268}\times{50} \right )+{1,129.2}={997.9}\\ &\text{Expected}Y\left({6}\right)=\left( -{2.6268}\times{45} \right )+{1,129.2}={1,011}\\ \end{aligned}$

Next, the differences of the actual “y” values vs. the expected “y” values, the errors, are calculated:

$\begin{aligned} &\text{Error}\left({1}\right)=\left( {1,100}-{1,102.9} \right )={-2.9}\\ &\text{Error}\left({2}\right)=\left( {1,200}-{1,076.7} \right )={123.3}\\ &\text{Error}\left({3}\right)=\left( {985}-{1,037.3} \right )={-52.3}\\ &\text{Error}\left({4}\right)=\left( {750}-{1,024.1} \right )={-274.1}\\ &\text{Error}\left({5}\right)=\left( {1,215}-{997.9} \right )={217.1}\\ &\text{Error}\left({6}\right)=\left( {1,000}-{1,011} \right )={-11}\\ \end{aligned}$

Next, these errors must be [squared and summed](https://www.investopedia.com/terms/s/sum-of-squares.asp):

$\begin{aligned} &\text{Sum of Errors Squared =}\\ &\left({-2.9}^{2}+{123.3}^{2}+{-52.3}^{2}+{-274.1}^{2}+{217.1}^{2}+{-11}^{2}\right)= \\ &{140,330.81}\\ &\text{}\\ \end{aligned}$

Next, the value of the error minus the previous error are calculated and squared:

$\begin{aligned} &\text{Difference}\left({1}\right)=\left( {123.3}-\left({-2.9}\right) \right )={126.2}\\ &\text{Difference}\left({2}\right)=\left( {-52.3}-{123.3} \right )={-175.6}\\ &\text{Difference}\left({3}\right)=\left( {-274.1}-\left({-52.3}\right) \right )={-221.9}\\ &\text{Difference}\left({4}\right)=\left( {217.1}-\left({-274.1}\right) \right )={491.3}\\ &\text{Difference}\left({5}\right)=\left( {-11}-{217.1} \right )={-228.1}\\ &\text{Sum of Differences Square}={389,406.71}\\ \end{aligned}$

Finally, the Durbin-Watson statistic is the quotient of the squared values:

$\text{Durbin Watson}={389,406.71}/{140,330.81}={2.77}$

Note: Tenths place may be off due to rounding errors in the squaring

> **Article Sources**
>
> 1.  University of Notre Dame. “[Durbin-Watson Significance Tables](https://www3.nd.edu/~wevans1/econ30331/Durbin_Watson_tables.pdf)." Page 1.
>     
> 2.  Springer Link. “[Durbin-Watson Test](https://link.springer.com/referenceworkentry/10.1007/978-0-387-32833-1_122).”