| pdwtest {plm} | R Documentation |
Test of serial correlation for (the idiosyncratic component of) the errors in panel models.
pdwtest(x, ...) ## S3 method for class 'panelmodel': pdwtest(x, ...) ## S3 method for class 'formula': pdwtest(x, data, model, index = NULL, ...)
x |
an object of class "panelmodel" or of class "formula", |
data |
a data.frame |
model |
one of "within", "random" or
"pooling" |
index |
the index of the data.frame, |
... |
further arguments to be passed on to dwtest. |
This Durbin–Watson test uses the auxiliary model on (quasi-)demeaned
data taken from a model of class plm which may be a
pooling, 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.
An object of class "htest".
Giovanni Millo
Baltagi, B.H. (2005) Econometric analysis of panel data, Wiley, p.98.
Wooldridge, J.M. (2002) Econometric analysis of cross-section and panel data, MIT Press, page 288.
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="Ecdat")
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")