durbinWatsonTest {car} | R Documentation |
Durbin-Watson Test for Autocorrelated Errors
Description
Computes residual autocorrelations and generalized Durbin-Watson
statistics and their bootstrapped p-values. dwt
is an
abbreviation for durbinWatsonTest
.
Usage
durbinWatsonTest(model, ...)
dwt(...)
## S3 method for class 'lm'
durbinWatsonTest(model, max.lag=1, simulate=TRUE, reps=1000,
method=c("resample","normal"),
alternative=c("two.sided", "positive", "negative"), ...)
## Default S3 method:
durbinWatsonTest(model, max.lag=1, ...)
## S3 method for class 'durbinWatsonTest'
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 |
reps |
number of bootstrap replications. |
method |
bootstrap method: |
alternative |
sign of autocorrelation in alternative hypothesis; specify
only if |
... |
arguments to be passed down. |
x |
|
Value
Returns an object of type "durbinWatsonTest"
.
Note
p-values are available only from the lm
method.
Author(s)
John Fox jfox@mcmaster.ca
References
Fox, J. (2016) Applied Regression Analysis and Generalized Linear Models, Third Edition. Sage.
Examples
durbinWatsonTest(lm(fconvict ~ tfr + partic + degrees + mconvict, data=Hartnagel))