vcovBS {sandwich} | R Documentation |
Estimation of basic bootstrap covariances, using a simple (clustered) case-based resampling. covariance matrices using an object-oriented approach.
vcovBS(x, ...) ## Default S3 method: vcovBS(x, cluster = NULL, R = 250, start = FALSE, ...)
x |
a fitted model object. |
cluster |
a variable indicating the clustering of observations. By default each observation is its own cluster. |
R |
integer. Number of bootstrap replications. |
start |
logical. Should |
... |
arguments passed to methods (to |
Basic (clustered) bootstrap covariance matrix estimation is provided by
vcovBS
. The default method samples clusters (where each observation
is its own cluster by default), i.e. case-based resampling. For obtaining
a covariance matrix estimate it is assumed that an update
of the model with the resampled subset can be obtained, the coef
extracted, and finally the covariance computed with cov
.
Note: The update
model is evaluated in the environment(terms(x))
.
A matrix containing the covariance matrix estimate.
## Petersen's data data("PetersenCL", package = "sandwich") m <- lm(y ~ x, data = PetersenCL) ## comparison of different standard errors set.seed(1) cbind( "classical" = sqrt(diag(vcov(m))), "HC-cluster" = sqrt(diag(vcovCL(m, cluster = PetersenCL$firm))), "BS-cluster" = sqrt(diag(vcovBS(m, cluster = PetersenCL$firm))) )