autocor {s20x}R Documentation

Autocorrelation Plot and Test

Description

Plots current vs lagged residuals and performs the Durbin-Watson test for serial correlation.

Usage

autocor(fit)

Arguments

fit output from the function "lm()".

Value

Plots current vs lagged residuals and returns the Durbin-Watson test statistic and rho, the estimated autocorrelation coefficient

Examples

data(airpass)
attach(airpass)
time<-1:144
airpass.fit<-lm(passengers~time)
autocor(airpass.fit)
detach(airpass)

[Package s20x version 2.0.1 Index]