How to Calculate Durbin-Watson Statistic

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
Show More

Instructions

    • 1

      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.

    • 2

      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

    • 3

      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

    • 4

      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.

    • 5

      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.

Learnify Hub © www.0685.com All Rights Reserved