Learn R Programming

lmtest (version 0.2-2)

dwtest: Durbin-Watson-Test

Description

dwtest performs the Durbin-Watson-Test on autocorrelation of disturbances.

Usage

dwtest(formula, data=list())

Arguments

formula
a symbolic describtion for the model to be tested
data
an optional data frame containing the variables in the model. By default the variables are taken from the environment which 'dwtest' is called from

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the test statistic.
  • p.valuethe null distribution depends on X and is hardly trackable, so p.value is NA
  • methoda character string indicating what type of test was performed.
  • data.namea character string giving the name(s) of the data.

References

Kraemer, W., Sonnberger, H. (1986): The linear regression model under test

See Also

lm

Examples

Run this code
x <- c(1:30)
ut <- c(1:30)
# creating a ARMA(1) process
for(i in (2:30))
{
	ut[i] <- 1 * ut[i-1] + rnorm(1,0,2)
}
y <- x + ut
dw <- dwtest(y ~ x)

Run the code above in your browser using DataLab