Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say in linear regression, I got a fit and I can plot residuals to see whether there is any systematic trend in such a plot. How to quantitatively determine whether the residues are really random? Is Durbin-Watson test used for this purpose? How to interpret such test if so?

Please provide an example, preferably in R.

share|improve this question
Related:… – cardinal Dec 17 '11 at 21:53
See also the Breusch-Pagan test, where a reference to an $R$ implementation is also given. – cardinal Dec 17 '11 at 21:53

This also depends on the type of data you have. Do you have a time series? Then looking at a ACF/PACF plot of the residuals may be one way of determining if these are white noise:


you may find this PDF helpful.

If you have cross-section data an inspection of the residual plots yields very valuable information in my opinion:

plot(lm(speed~dist, data=cars))

There exist tests (see comments) but I very often find graphs more useful.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.