The DurbinWatson 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 timeseries 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 DurbinWatson statistic using Stata will allow you to see if this is an issue of concern.
Things You'll Need
 Stata, version 9 or higher
 Timeseries 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 DurbinWatson 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 DurbinWatson 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 pvalue and the chisquared statistics. The pvalue tests for serial correlation. If the pvalue 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
 Introductory Econometrics: A Modern Approach; Jeffrey Wooldridge; 2009
 UCLA Academic Technology Services: StataRegression Analysis by Example
 Photo Credit Girl having too much work to do image by Angel_a from Fotolia.com