This article includes a list ofgeneral references, butit lacks sufficient correspondinginline citations. Please help toimprove this article byintroducing more precise citations.(December 2012) (Learn how and when to remove this message) |
Instatistics, theDurbin–Watson statistic is atest statistic used to detect the presence ofautocorrelation at lag 1 in theresiduals (prediction errors) from aregression analysis. It is named afterJames Durbin andGeoffrey Watson. Thesmall sample distribution of this ratio was derived byJohn von Neumann (von Neumann, 1941). Durbin and Watson (1950, 1951) applied this statistic to the residuals fromleast squares regressions, and developed bounds tests for thenull hypothesis that the errors are serially uncorrelated against the alternative that they follow a first orderautoregressive process. Note that the distribution of this test statistic does not depend on the estimated regression coefficients and the variance of the errors.[1]
A similar assessment can be also carried out with theBreusch–Godfrey test and theLjung–Box test.
If is theresidual given by the Durbin-Watsontest statistic is
where is the number of observations. For large, is approximately equal to, where is the sample autocorrelation of the residuals at lag 1.[2] therefore indicates no autocorrelation. The value of always lies between and. If the Durbin–Watson statistic is substantially less than 2, there is evidence of positive serial correlation. As a rough rule of thumb, if Durbin–Watson is less than 1.0, there may be cause for alarm. Small values of indicate successive error terms are positively correlated. If, successive error terms are negatively correlated. In regressions, this can imply an underestimation of the level ofstatistical significance.
To test forpositive autocorrelation at significance, the test statistic is compared to lower and upper critical values ( and):
Positive serial correlation is serial correlation in which a positive error for one observation increases the chances of a positive error for another observation.
To test fornegative autocorrelation at significance, the test statistic is compared to lower and upper critical values ( and):
Negative serial correlation implies that a positive error for one observation increases the chance of a negative error for another observation and a negative error for one observation increases the chances of a positive error for another.
The critical values, and, vary by level of significance () and the degrees of freedom in the regression equation. Their derivation is complex—statisticians typically obtain them from the appendices of statistical texts.
If thedesign matrix of the regression is known, exact critical values for the distribution of under the null hypothesis of no serial correlation can be calculated. Under the null hypothesis is distributed as
where is the number of observations and is number of regression variables; the are independent standard normal random variables; and the are the nonzero eigenvalues ofwhere is the matrix that transforms the residuals into the statistic, i.e.[3] A number of computational algorithms for finding percentiles of this distribution are available.[4]
Although serial correlation does not affect the consistency of the estimated regression coefficients, it does affect our ability to conduct valid statistical tests. First, the F-statistic to test for overall significance of the regression may be inflated under positive serial correlation because the mean squared error (MSE) will tend to underestimate the population error variance. Second, positive serial correlation typically causes the ordinary least squares (OLS) standard errors for the regression coefficients to underestimate the true standard errors. As a consequence, if positive serial correlation is present in the regression, standard linear regression analysis will typically lead us to compute artificially small standard errors for the regression coefficient. These small standard errors will cause the estimated t-statistic to be inflated, suggesting significance where perhaps there is none. The inflated t-statistic, may in turn, lead us to incorrectly reject null hypotheses, about population values of the parameters of the regression model more often than we would if the standard errors were correctly estimated.
If the Durbin–Watson statistic indicates the presence of serial correlation of the residuals, this can be remedied by using theCochrane–Orcutt procedure.
The Durbin–Watson statistic, while displayed by many regression analysis programs, is not applicable in certain situations. For instance, when lagged dependent variables are included in the explanatory variables, then it is inappropriate to use this test. Durbin's h-test (see below) or likelihood ratio tests, that are valid in large samples, should be used.
The Durbin–Watson statistic isbiased forautoregressive moving average models, so that autocorrelation is underestimated. But for large samples one can easily compute the unbiasednormally distributed h-statistic:
using the Durbin–Watson statisticd and the estimated variance
of the regression coefficient of the lagged dependent variable, provided
dwtest function in the lmtest package,durbinWatsonTest (or dwt for short) function in the car package, andpdwtest andpbnftest for panel models in the plm package.[5]estat dwatson, followingregress in time series data.[6] Engle's LM test for autoregressive conditional heteroskedasticity (ARCH), a test for time-dependent volatility, the Breusch–Godfrey test, and Durbin's alternative test for serial correlation are also available. All (except -dwatson-) tests separately for higher-order serial correlations. The Breusch–Godfrey test and Durbin's alternative test also allow regressors that are not strictly exogenous.=SUMXMY2(x_array,y_array)/SUMSQ(array)statsmodels.stats.stattools.durbin_watson), but statistical tables for critical values are not available there.