pbgtest {plm} | R Documentation

## 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, type = c("Chisq", "F"), ...)
    ## S3 method for class 'formula'
    pbgtest(x, order = NULL, type = c("Chisq", "F"),
               data, model=c("pooling", "random", "within"), ...)

### Arguments

`x` | an object of class `"panelmodel"` or of class `"formula"`,
`order` | an integer indicating the order of serial correlation to be tested for. `NULL` (default) uses the minimum number of observations over the time dimension (see also section Details below),
`type` | type of test statistic to be calculated; either `"Chisq"` (default) for the Chi-squared test statistic or `"F"` for the F test statistic,
`data` | only relevant for formula interface: data set for which the respective panel model (see `model`) is to be evaluated,
`model` | only relevant for formula interface: compute test statistic for model `pooling` (default), `random`, or `within`. When `model` is used, the `data` argument needs to be passed as well,
`...` | further arguments (see `?lmtest::bgtest`).

### 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` (default for formula interface), `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/2010). 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.

### Value

An object of class `"htest"`.

### Note

The argument `order` defaults to the minimum number of observations over the time dimension, while for `lmtest::bgtest` it defaults to `1`.

### Author(s)

Giovanni Millo

### 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–1301.

Wooldridge, J.M. (2002) Econometric Analysis of Cross-Section and Panel Data, MIT Press, pp. 288–291.

Wooldridge, J.M. (2010) Econometric analysis of cross-section and Panel Data, 2nd ed., MIT Press, pp. 328–334.

Wooldridge, J.M. (2013) Introductory Econometrics: A Modern Approach, 5th ed., South-Western (Cengage Learning), Sec. 12.2, pp. 421–422.

### See Also

`pdwtest` for the analogous panel 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. For the original test in package `lmtest` see `bgtest`.

### Examples

    data("Grunfeld", package = "plm")
    g <- plm(inv ~ value + capital, data = Grunfeld, model = "random")

    # panelmodel interface
    pbgtest(g)
    pbgtest(g, order = 4)

    # formula interface
    pbgtest(inv ~ value + capital, data = Grunfeld, model = "random")

    # F test statistic (instead of default type="Chisq")
    pbgtest(g, type="F")
    pbgtest(inv ~ value + capital, data = Grunfeld, model = "random", type="F")

    # same output as lmtest::bgtest [see Note]
    pbgtest(g, order = 1)
    lmtest::bgtest(g, order = 1)

[Package plm version 1.5-12 Index]