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)
Run the code above in your browser using DataLab