The Durbin–Watson test detects correlation among regression residuals, testing whether the independence assumption is plausible. Its statistic ranges from 0 to 4. section 4.2.4
Interpret the statistic as follows:
- Values between 1.5 and 2.5 generally support failing to reject the null hypothesis of no residual correlation. section 4.2.4
- Values near 0 indicate stronger positive correlation, while values near 4 indicate stronger negative correlation. section 4.2.4
- Compute the statistic as squared differences between successive residuals divided by total squared residuals. section 4.2.4
Python calculation
Pass the fitted model's residuals to statsmodels: from statsmodels.stats.stattools import durbin_watson; print(durbin_watson(lm.resid)). A reported value of 2.3264601831112186 supports the independence assumption under the stated interpretation. section 4.2.4
