Run panel-data heteroscedasticity tests
runPanelTests.RdBreusch-Pagan LM and Pesaran CD tests for panel models.
Usage
runPanelTests(model, data, id, time = NULL,
tests = c("bp_random", "pesaran"))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")
#> $bp_random
#>
#> Breusch-Pagan LM test for random effects
#>
#> data: y ~ x
#> LM = 1.1931, = 1, p-value = 0.2747
#>
#>
#> $pesaran
#>
#> Pesaran CD test for cross-sectional dependence
#>
#> data: y ~ x
#> z = -1.6673, p-value = 0.09545
#>
#>