Robust estimation
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, ... ) p_value_robust( model, vcov_estimation = "HC", vcov_type = NULL, vcov_args = NULL, ... ) ci_robust( model, ci = 0.95, vcov_estimation = "HC", vcov_type = NULL, vcov_args = NULL, ... )
model |
A model. |
vcov_estimation |
String, indicating the suffix of the |
vcov_type |
Character vector, specifying the estimation type for the
robust covariance matrix estimation (see |
vcov_args |
List of named vectors, used as additional arguments that
are passed down to the sandwich-function specified in |
... |
Arguments passed to or from other methods. For |
ci |
Confidence Interval (CI) level. Default to 0.95 (95%). |
A data frame.
These functions rely on the sandwich or clubSandwich package
(the latter if vcov_estimation = "CR" for cluster-robust standard errors)
and will thus only work for those models supported by those packages.
Working examples cam be found in this vignette.
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)
)
}
## End(Not run)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.