Learn R Programming

plm (version 0.3-1)

pbgtest: Breusch--Godfrey Test for Panel Models

Description

Test of serial correlation for (the idiosyncratic component of) the errors in panel models.

Usage

pbgtest(x,...)
## S3 method for class 'panelmodel':
pbgtest(x, order = NULL, ...)
## S3 method for class 'formula':
pbgtest(x, data, model = "random", order = NULL, ...)

Arguments

x
an object of class "panelmodel" or of class "formula",
data
a data.frame
model
one of within, random or pooling
order
an integer indicating the order of serial correlation to be tested for. Defaults to the minimum numerosity over the time dimension,
...
further arguments.

Value

  • An object of class "htest".

Details

This Lagrange multiplier 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 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.

References

Breusch, T. (1978) Testing for autocorrelation in dynamic linear models, Australian Economic Papers, 17, pp.334--355. Godfrey, L. (1978) Testing against general autoregressive and moving average error models when the regressors include lagged dependent variables, Econometrica, 46; pp. 1293--1302. Wooldridge, J.M. (2002) Econometric analysis of cross-section and panel data, MIT Press, page 288.

See Also

pdwtest for the analogous Durbin--Watson test,bgtest for the Breusch--Godfrey test for serial correlation in the linear model.

Examples

Run this code
data("Grunfeld",package="Ecdat")
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