durbin.watson

0th

Percentile

Durbin-Watson Test for Autocorrelated Errors

Computes residual autocorrelations and generalized Durbin-Watson statistics and their bootstrapped p-values.

Keywords
regression, ts
Usage
durbin.watson(model, ...)

durbin.watson.lm(model, max.lag=1, simulate=T, reps=1000,
    method=c("resample","normal"))

durbin.watson.default(residuals, max.lag=1)
Arguments
model
a linear-model object.
max.lag
maximum lag to which to compute residual autocorrelations and Durbin-Watson statistics.
simulate
if TRUE p-values will be estimated by bootstrapping.
reps
number of bootstrap replications.
method
bootstrap method: "resample" to resample from the observed residuals; "normal" to sample normally distributed errors with 0 mean and standard deviation equal to the standard error of the regression.
residuals
vector of residuals from a linear model.
...
arguments to be passed down to method functions.
Value

  • Returns an object of type "durbin.watson".

References

Fox, J. (1997) Applied Regression, Linear Models, and Related Methods. Sage.

Aliases
  • durbin.watson
  • durbin.watson.lm
  • durbin.watson.default
  • print.durbin.watson
Examples
data(Hartnagel)
durbin.watson(lm(fconvict ~ tfr + partic + degrees + fconvict, data=Hartnagel))
##  lag Autocorrelation D-W Statistic p-value
##    1          0.6894        0.6148       0
Documentation reproduced from package car, version 0.8-3, License: GPL version 2 or newer

Community examples

Looks like there are no examples yet.