File: pbgtest.Rd

package info (click to toggle)
r-cran-plm 2.6-2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,032 kB
  • sloc: sh: 13; makefile: 4
file content (109 lines) | stat: -rw-r--r-- 3,448 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/test_serial.R
\name{pbgtest}
\alias{pbgtest}
\alias{pbgtest.panelmodel}
\alias{pbgtest.formula}
\title{Breusch--Godfrey Test for Panel Models}
\usage{
pbgtest(x, ...)

\method{pbgtest}{panelmodel}(x, order = NULL, type = c("Chisq", "F"), ...)

\method{pbgtest}{formula}(
  x,
  order = NULL,
  type = c("Chisq", "F"),
  data,
  model = c("pooling", "random", "within"),
  ...
)
}
\arguments{
\item{x}{an object of class \code{"panelmodel"} or of class \code{"formula"},}

\item{\dots}{further arguments (see \code{\link[lmtest:bgtest]{lmtest::bgtest()}}).}

\item{order}{an integer indicating the order of serial correlation
to be tested for. \code{NULL} (default) uses the minimum number of
observations over the time dimension (see also section
\strong{Details} below),}

\item{type}{type of test statistic to be calculated; either
\code{"Chisq"} (default) for the Chi-squared test statistic or \code{"F"}
for the F test statistic,}

\item{data}{only relevant for formula interface: data set for which
the respective panel model (see \code{model}) is to be evaluated,}

\item{model}{only relevant for formula interface: compute test
statistic for model \code{pooling} (default), \code{random}, or \code{within}.
When \code{model} is used, the \code{data} argument needs to be passed as
well,}
}
\value{
An object of class \code{"htest"}.
}
\description{
Test of serial correlation for (the idiosyncratic component of) the
errors in panel models.
}
\details{
This Lagrange multiplier test uses the auxiliary model on
(quasi-)demeaned data taken from a model of class \code{plm} which may
be a \code{pooling} (default for formula interface), \code{random} or
\code{within} model. It performs a Breusch--Godfrey test (using \code{bgtest}
from package \CRANpkg{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 \insertCite{WOOL:10;textual}{plm}. The function
takes the demeaned data, estimates the model and calls \code{bgtest}.

Unlike most other tests for serial correlation in panels, this one
allows to choose the order of correlation to test for.
}
\note{
The argument \code{order} defaults to the minimum number of
observations over the time dimension, while for
\code{lmtest::bgtest} it defaults to \code{1}.
}
\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")

}
\references{
\insertRef{BREU:78}{plm}

\insertRef{GODF:78}{plm}

\insertRef{WOOL:02}{plm}

\insertRef{WOOL:10}{plm}

\insertRef{WOOL:13}{plm}
Sec. 12.2, pp. 421--422.
}
\seealso{
For the original test in package \CRANpkg{lmtest} see
\code{\link[lmtest:bgtest]{lmtest::bgtest()}}.  See \code{\link[=pdwtest]{pdwtest()}} for the analogous
panel Durbin--Watson test.  See \code{\link[=pbltest]{pbltest()}}, \code{\link[=pbsytest]{pbsytest()}},
\code{\link[=pwartest]{pwartest()}} and \code{\link[=pwfdtest]{pwfdtest()}} for other serial correlation
tests for panel models.
}
\author{
Giovanni Millo
}
\keyword{htest}