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, ...)

## S3 method for class 'lm':
durbin.watson(model, max.lag=1, simulate=TRUE, reps=1000,
    method=c("resample","normal"),
    alternative=c("two.sided", "positive", "negative"), ...)

## S3 method for class 'default':
durbin.watson(model, max.lag=1, ...)

## S3 method for class 'durbin.watson':
print(x, ...)
Arguments
model
a linear-model object, or a vector of residuals from a linear model.
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.
alternative
sign of autocorrelation in alternative hypothesis; specify only if max.lag = 1; if max.lag > 1, then alternative is taken to be "two.sided".
...
arguments to be passed down to method functions.
x
durbin.watson object.
Value

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

Note

p-values are available only from the lm method.

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
durbin.watson(lm(fconvict ~ tfr + partic + degrees + mconvict, data=Hartnagel))
##  lag Autocorrelation D-W Statistic p-value 
##    1        0.688345     0.6168636       0 
##  Alternative hypothesis: rho != 0
Documentation reproduced from package car, version 1.2-15, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.