pbgtest(x,...)
## S3 method for class 'panelmodel':
pbgtest(x, order = NULL, ...)
## S3 method for class 'formula':
pbgtest(x, ..., order = NULL)
"panelmodel"
or of class "formula"
,"htest"
.plm
which may
be a pooling
(the default), random
or within
model. It performs a
Breusch--Godfrey test (using bgtest
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, as illustrated in Wooldridge (2002). The function takes the
demeaned data, estimates the model and calls bgtest
. Unlike most
other tests for serial correlation in panels, this one allows to choose
the order of correlation to test for.pdwtest
for the analogous Durbin--Watson
test, bgtest
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")
pbgtest(g)
pbgtest(g, order = 4)
## formula interface
pbgtest(inv ~ value + capital, data = Grunfeld, model = "random")
Run the code above in your browser using DataLab