Various Versatile Variances: An Object-Oriented Implementation of Clustered Covariances in R

Clustered covariances or clustered standard errors are very widely used to account for correlated or clustered data, especially in economics, political sciences, and other social sciences. They are employed to adjust the inference following estimation of a standard least-squares regression or genera...

Full description

Saved in:
Bibliographic Details
Published inJournal of statistical software Vol. 95; no. 1; pp. 1 - 36
Main Authors Zeileis, Achim, Köll, Susanne, Graham, Nathaniel
Format Journal Article
LanguageEnglish
Published Foundation for Open Access Statistics 01.10.2020
Subjects
Online AccessGet full text
ISSN1548-7660
1548-7660
DOI10.18637/jss.v095.i01

Cover

Loading…
More Information
Summary:Clustered covariances or clustered standard errors are very widely used to account for correlated or clustered data, especially in economics, political sciences, and other social sciences. They are employed to adjust the inference following estimation of a standard least-squares regression or generalized linear model estimated by maximum likelihood. Although many publications just refer to "the" clustered standard errors, there is a surprisingly wide variety of clustered covariances, particularly due to different flavors of bias corrections. Furthermore, while the linear regression model is certainly the most important application case, the same strategies can be employed in more general models (e.g., for zero-inflated, censored, or limited responses). In R, functions for covariances in clustered or panel models have been somewhat scattered or available only for certain modeling functions, notably the (generalized) linear regression model. In contrast, an object-oriented approach to "robust" covariance matrix estimation - applicable beyond lm() and glm() - is available in the sandwich package but has been limited to the case of cross-section or time series data. Starting with sandwich 2.4.0, this shortcoming has been corrected: Based on methods for two generic functions (estfun() and bread()), clustered and panel covariances are provided in vcovCL(), vcovPL(), and vcovPC(). Moreover, clustered bootstrap covariances are provided in vcovBS(), using model update() on bootstrap samples. These are directly applicable to models from packages including MASS, pscl, countreg, and betareg, among many others. Some empirical illustrations are provided as well as an assessment of the methods' performance in a simulation study.
ISSN:1548-7660
1548-7660
DOI:10.18637/jss.v095.i01