Skip to content

Perform Pesaran CD test

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

Checks for cross-sectional dependence in panel residuals.

Usage

performPesaranTest(model, data = NULL, id, time)

Arguments

model
an object of class lm.
data
data frame used to fit model. When NULL, the default, the model frame of model is used, so id and time must then be variables of the model. The model frame holds the terms of the model rather than its variables (log(x) rather than x), so a model that transforms a variable needs data, as does a model with an offset() term.
id
individual identifier column.
time
time column.

Value

An object of class htest.

Details

The statistic averages pairwise correlation coefficients of the residuals and is standardized to follow a normal distribution under the null of independence.

References

Pesaran, M. H. (2004). General diagnostic tests for cross section dependence in panels. Cambridge Working Papers in Economics.

Examples

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