dwtest {lmtest}R Documentation

Durbin-Watson Test

Description

Performs the Durbin-Watson test for autocorrelation of disturbances.

Usage

dwtest(formula, order.by = NULL, alternative = c("greater", "two.sided", "less"),
       iterations = 15, exact = NULL, tol = 1e-10, data = list())

Arguments

formula a symbolic description for the model to be tested (or a fitted "lm" object).
order.by Either a vector z or a formula with a single explanatory variable like ~ z. The observations in the model are ordered by the size of z. If set to NULL (the default) the observations are assumed to be ordered (e.g., a time series).
alternative a character string specifying the alternative hypothesis.
iterations an integer specifying the number of iterations when calculating the p-value with the "pan" algorithm.