setup_vcov | R Documentation |
vcov_control
argumentsReturns a list with two elements called estimator
and arguments
. The element estimator
is a string specifying the covariance matrix estimator to be used in the linear regression regression of interest and needs to be a covariance estimator function in the "sandwich" package. The second element, arguments
, is a list of arguments that shall be passed to the function specified in the first element, estimator
.
setup_vcov(estimator = "vcovHC", arguments = list(type = "const"))
estimator |
Character specifying a covariance matrix estimator in the "sandwich" package. Default is |
arguments |
A list of arguments that are to be passed to the function in the |
The output of this setup function is intended to be used as argument in the functions GenericML()
and GenericML_single()
(arguments vcov_BLP
, vcov_GATES
), as well as BLP()
and GATES()
(argument vcov_control
).
An object of class "setup_vcov"
, consisting of the following components:
estimator
A character equal to covariance estimation function names in the "sandwich" package.
arguments
A list of arguments that shall be passed to the function specified in the estimator
argument.
See the description above for details.
Zeileis A. (2004). “Econometric Computing with HC and HAC Covariance Matrix Estimators.” Journal of Statistical Software, 11(10), 1–17. doi: 10.18637/jss.v011.i10
Zeileis A. (2006). “Object-Oriented Computation of Sandwich Estimators.” Journal of Statistical Software, 16(9), 1–16. doi: 10.18637/jss.v016.i09
GenericML()
,
GenericML_single()
,
BLP()
,
GATES()
,
setup_X1()
,
setup_diff()
# use standard homoskedastic OLS covariance matrix estimate setup_vcov(estimator = "vcovHC", arguments = list(type = "const")) # use White's heteroskedasticity-robust estimator setup_vcov(estimator = "vcovHC", arguments = list(type = "HC0")) if (require("sandwich")){ # use HAC-robust estimator with prewhitening and Andrews' (Econometrica, 1991) weights # since weightsAndrews() is a function in 'sandwich', require this package setup_vcov(estimator = "vcovHAC", arguments = list(prewhite = TRUE, weights = weightsAndrews)) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.