Description Usage Arguments Details Value Author(s) References See Also Examples
Generic Lego building block for robust covariance matrix estimators of the vcovXX kind for panel models.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | vcovG(x, ...)
## S3 method for class 'plm'
vcovG(
x,
type = c("HC0", "sss", "HC1", "HC2", "HC3", "HC4"),
cluster = c("group", "time"),
l = 0,
inner = c("cluster", "white", "diagavg"),
...
)
## S3 method for class 'pcce'
vcovG(
x,
type = c("HC0", "sss", "HC1", "HC2", "HC3", "HC4"),
cluster = c("group", "time"),
l = 0,
inner = c("cluster", "white", "diagavg"),
...
)
|
x |
an object of class |
... |
further arguments |
type |
the weighting scheme used, one of |
cluster |
one of |
l |
lagging order, defaulting to zero |
inner |
the function to be applied to the residuals inside the
sandwich: one of |
vcovG
is the generic building block for use by higher–level
wrappers vcovHC()
, vcovSCC()
, vcovDC()
, and vcovNW()
. The
main use of vcovG
is to be used internally by the former, but it
is made available in the user space for use in non–standard
combinations. For more documentation, see see wrapper functions
mentioned.
An object of class "matrix"
containing the estimate
of the covariance matrix of coefficients.
Giovanni Millo
mil17bplm
vcovHC()
, vcovSCC()
,
vcovDC()
, vcovNW()
, and
vcovBK()
albeit the latter does not make use of
vcovG.
1 2 3 4 5 6 7 8 9 10 11 12 13 | data("Produc", package="plm")
zz <- plm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp, data=Produc,
model="pooling")
## reproduce Arellano's covariance matrix
vcovG(zz, cluster="group", inner="cluster", l=0)
## define custom covariance function
## (in this example, same as vcovHC)
myvcov <- function(x) vcovG(x, cluster="group", inner="cluster", l=0)
summary(zz, vcov = myvcov)
## use in coefficient significance test
library(lmtest)
## robust significance test
coeftest(zz, vcov. = myvcov)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.