autocor {s20x} | R Documentation |
Plots current vs lagged residuals and performs the Durbin-Watson test for serial correlation.
autocor(fit)
fit |
output from the function "lm()". |
Plots current vs lagged residuals and returns the Durbin-Watson test statistic and rho, the estimated autocorrelation coefficient
data(airpass) attach(airpass) time<-1:144 airpass.fit<-lm(passengers~time) autocor(airpass.fit) detach(airpass)