# NOT RUN {
model <- lm(Petal.Length ~ Sepal.Length * Species, data = iris)
standard_error(model)
# robust standard errors, calling sandwich::vcovHC(type="HC3") by default
standard_error_robust(model)
# 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