These tests are originally meant to use the residuals of separate
estimation of one time--series regression for each cross-sectional
unit in order to check for cross--sectional dependence (model = NULL
).
If a different model specification (model = "within"
, "random"
,
...) is assumed consistent, one can resort to its residuals for
testing (which is common, e.g., when the time dimension's length is
insufficient for estimating the heterogeneous model).
If the time
dimension is insufficient and model = NULL
, the function defaults
to estimation of a within
model and issues a warning. The main
argument of this function may be either a model of class
panelmodel
or a formula
and data frame
; in the second case,
unless model
is set to NULL
, all usual parameters relative to
the estimation of a plm
model may be passed on. The test is
compatible with any consistent panelmodel
for the data at hand,
with any specification of effect
(except for test = "bcsclm"
which
requires a within model with either individual or two-ways effect).
E.g., specifying effect = "time"
or effect = "twoways"
allows
to test for residual cross-sectional dependence after the introduction
of time fixed effects to account for common shocks.
A local version of either test can be computed by supplying a
proximity matrix (elements coercible to logical
) with argument
w
which provides information on whether any pair of individuals
are neighbours or not. If w
is supplied, only neighbouring pairs
will be used in computing the test; else, w
will default to
NULL
and all observations will be used. The matrix need not be
binary, so commonly used "row--standardized" matrices can be
employed as well. nb
objects from spdep must instead be
transformed into matrices by spdep's function nb2mat
before using.
The methods implemented are suitable also for unbalanced panels.
Pesaran's CD test (test="cd"
), Breusch and Pagan's LM test
(test="lm"
), and its scaled version (test="sclm"
) are all
described in PESA:04;textualplm (and complemented by
Pesaran (2005)). The bias-corrected scaled test (test="bcsclm"
)
is due to BALT:FENG:KAO:12plm and only valid for
within models including the individual effect (it's unbalanced
version uses max(Tij) for T) in the bias-correction term).
BREU:PAGA:80;textualplm is the original source for
the LM test.
The test on a pseries
is the same as a test on a pooled
regression model of that variable on a constant, i.e.,
pcdtest(some_pseries)
is equivalent to pcdtest(plm(some_var ~ 1, data = some_pdata.frame, model = "pooling")
and also equivalent to
pcdtest(some_var ~ 1, data = some_data)
, where some_var
is
the variable name in the data which corresponds to some_pseries
.