Computes residual autocorrelations and generalized Durbin-Watson
  statistics and their bootstrapped p-values. dwt is an
  abbreviation for durbinWatsonTest.
durbinWatsonTest(model, ...)dwt(...)
# S3 method for lm
durbinWatsonTest(model, max.lag=1, simulate=TRUE, reps=1000,
    method=c("resample","normal"),
    alternative=c("two.sided", "positive", "negative"), ...)
# S3 method for default
durbinWatsonTest(model, max.lag=1, ...)
# S3 method for durbinWatsonTest
print(x, ...)
Returns an object of type "durbinWatsonTest".
a linear-model object, or a vector of residuals from a linear model.
maximum lag to which to compute residual autocorrelations and Durbin-Watson statistics.
if TRUE p-values will be estimated by bootstrapping.
number of bootstrap replications.
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.
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.
durbinWatsonTest object.
John Fox jfox@mcmaster.ca
Fox, J. (2016) Applied Regression Analysis and Generalized Linear Models, Third Edition. Sage.
durbinWatsonTest(lm(fconvict ~ tfr + partic + degrees + mconvict, data=Hartnagel))
Run the code above in your browser using DataLab