pdwtest(x, ...)
## S3 method for class 'panelmodel':
pdwtest(x, ...)
## S3 method for class 'formula':
pdwtest(x, data, ...)
"panelmodel"
or of class
"formula"
,data.frame
,dwtest
."htest"
.plm
which may be a pooling
(the default), random
or within
model. It performs a dw test (using dwtest
from package lmtest
) on the residuals of the (quasi-)demeaned model, which should be serially uncorrelated under the null of no serial correlation in idiosyncratic errors. The function takes the demeaned data, estimates the model and calls dwtest
.pbgtest
for the analogous Breusch--Godfrey
test, dwtest
for the Breusch--Godfrey test for serial
correlation in the linear model. pbltest
,
pbsytest
, pwartest
and pwfdtest
for other serial correlation tests for panel models.data("Grunfeld", package = "plm")
g <- plm(inv ~ value + capital, data = Grunfeld, model="random")
pdwtest(g)
pdwtest(g, alternative="two.sided")
## formula interface
pdwtest(inv ~ value + capital, data=Grunfeld, model="random")
Run the code above in your browser using DataLab