The Durbin–Watson function is used for testing whether there is autocorrelation in the residuals from
a linear model or a generalized linear model, and is implemented as part of the car package (see
a linear model or a generalized linear model, and is implemented as part of the car package (see
Fox, 2002):
library("car")
durbinWatsonTest(model)
dataEllipse(explanatory,response)
The car package also contains functions for drawing ellipses, including data ellipses, and confidence
ellipses for linear and generalized linear models. Here is the dataEllipse function for the present
example: by default, the ellipses are drawn at 50% and 90%: