vcovG {plm} | R Documentation

## Generic Lego building block for Robust Covariance Matrix Estimators

### Description

Generic Lego building block for robust covariance matrix estimators of the vcovXX kind for panel models.

### Usage

    ## 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"),
                          ...)

### Arguments

`x` | an object of class `"plm"`
`type` | one of `"HC0"`, `"sss"`, `"HC1"`, `"HC2"`, `"HC3"`, `"HC4"`,
`cluster` | one of `"group"`, `"time"`,
`l` | lagging order, defaulting to zero
`inner` | the function to be applied to the residuals inside the sandwich: one of `"cluster"` or `"white"`,
`...` | further arguments

.

### Details

`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.

### Value

An object of class `"matrix"` containing the estimate of the covariance matrix of coefficients.

### Author(s)

Giovanni Millo

### References

Millo, G. (2014) Robust standard error estimators for panel models: a unifying approach Unpublished manuscript.

### Examples

    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)
    ## use in coefficient significance test
    library(lmtest)
    ## define custom covariance function
    ## (in this example, same as vcovHC)
    myvcov <- function(x) vcovG(x, cluster="group", inner="cluster", l=0)
    ## robust significance test
    coeftest(zz, vcov=myvcov)

[Package plm version 1.5-12 Index]