
Last chance! 50% off unlimited learning
Sale ends in
standard_error_robust()
, ci_robust()
and p_value_robust()
attempt to return indices based on robust estimation of the variance-covariance
matrix, using the packages sandwich and clubSandwich.
standard_error_robust(
model,
vcov_estimation = "HC",
vcov_type = NULL,
vcov_args = NULL,
component = "conditional",
...
)p_value_robust(
model,
vcov_estimation = "HC",
vcov_type = NULL,
vcov_args = NULL,
component = "conditional",
...
)
ci_robust(
model,
ci = 0.95,
vcov_estimation = "HC",
vcov_type = NULL,
vcov_args = NULL,
component = "conditional",
...
)
A model.
String, indicating the suffix of the vcov*()
-function
from the sandwich or clubSandwich package, e.g. vcov_estimation = "CL"
(which calls vcovCL
to compute clustered covariance matrix
estimators), or vcov_estimation = "HC"
(which calls
vcovHC()
to compute heteroskedasticity-consistent
covariance matrix estimators).
Character vector, specifying the estimation type for the
robust covariance matrix estimation (see vcovHC()
or clubSandwich::vcovCR()
for details).
List of named vectors, used as additional arguments that
are passed down to the sandwich-function specified in vcov_estimation
.
Should all parameters or parameters for specific model components be returned?
Arguments passed to or from other methods. For standard_error()
,
if method = "robust"
, arguments vcov_estimation
, vcov_type
and vcov_args
can be passed down to standard_error_robust()
.
Confidence Interval (CI) level. Default to 0.95 (95%).
A data frame.
Working examples cam be found in this vignette.
# NOT RUN {
if (require("sandwich", quietly = TRUE)) {
# robust standard errors, calling sandwich::vcovHC(type="HC3") by default
model <- lm(Petal.Length ~ Sepal.Length * Species, data = iris)
standard_error_robust(model)
}
# }
# NOT RUN {
if (require("clubSandwich", quietly = TRUE)) {
# cluster-robust standard errors, using clubSandwich
iris$cluster <- factor(rep(LETTERS[1:8], length.out = nrow(iris)))
standard_error_robust(
model,
vcov_type = "CR2",
vcov_args = list(cluster = iris$cluster)
)
}
# }
Run the code above in your browser using DataLab