Skip to content

Run panel-data heteroscedasticity tests

Source: man/runPanelTests.Rd ยท Help: ?runPanelTests

Breusch-Pagan LM and Pesaran CD tests for panel models.

Usage

runPanelTests(model, data, id, time = NULL,
          tests = c("bp_random", "pesaran"))

Arguments

model
A fitted lm object.
data
Data frame used to fit model. The two tests read id and time from the rows of data that hold the observations of the fit: since 0.16.0, data that are given are matched to the observations of the fit, by row name in any order, or by the row numbers or in the order of the fit for rows that only number themselves, as described under data in performPesaranTest().
id
Column identifying individuals.
time
Column identifying time periods for the Pesaran test, whose pairs of id and time must each hold one observation of the fit.
tests
Character vector of test names.

Value

A named list of htest objects.

See also

runTimeSeriesTests

Examples

 df <- data.frame(id = rep(1:3, each = 4), time = rep(1:4, 3),
                  x = runif(12), y = rnorm(12))
 m <- lm(y ~ x, data = df)
 runPanelTests(m, df, id = "id", time = "time")