# How to Calculate Durbin-Watson Statistic

Save

The Durbin-Watson statistic is a statistical tool that detects whether the residuals of the regression are autocorrelated. Autocorrelation is a statistical problem where the residuals of a time-series regression are not random, but instead have some type of pattern. This problem does not bias the coefficients of the estimate, but it does have an impact on the standard errors. This means that if your regression has autocorrelation problems, there may be results that appear to be statistically significant but are not. Thus, calculating a Durbin-Watson statistic using Stata will allow you to see if this is an issue of concern.

### Things You'll Need

• Stata, version 9 or higher
• Time-series data set
• Open up the database in Stata and format it in a time series format where each line of data represents a distinct year or time period.

• Create a dummy variable for each time period. If your data only has one period, you can use the code: gen year=_n. If your data are set up of different places observed over time, you can use: bysort place: gen year=_n, where place is whatever location you observed

• Use the tsset command to specify the time period of your data and allow the Durbin-Watson statistic to calculate. For example, if the data is set up where year is the time series variable, you would enter: tsset year

• Use the estat command to generate the Durbin-Watson statistic. Do this by using the code estat dwatson if your data are strictly endogenous and estat durbinalt if your data are not strictly endogenous.

• Interpret the results by looking the p-value and the chi-squared statistics. The p-value tests for serial correlation. If the p-value is greater than 0.05, then there is no serial correlation and your data are fine. If the p value is less than 0.05 then there are serial correlation issues that need to be addressed.

## Tips & Warnings

• This is a complex test that should not be done unless you have a firm understanding of statistics and regression

## References

• Photo Credit Girl having too much work to do image by Angel_a from Fotolia.com
Promoted By Zergnet

## Related Searches

Check It Out

### Can You Take Advantage Of Student Loan Forgiveness?

M
Is DIY in your DNA? Become part of our maker community.