tests/testthat/test-lm-robust-helper.R

# N <- 10000
# dat <- data.frame(y = rnorm(N), x1 = rnorm(N), x2 = rnorm(N))
# X <- model.matrix.default(~ x1 + x2, data = dat)
# y <- dat$y
# fit <- lm(y ~ x1 + x2, data = dat)
#
# # Speed Tests -------------------------------------------------------------
#
# system.time(replicate(500, lm_robust_helper(X = X, y = dat$y, type = "classical")))
#
# system.time(replicate(500, lm_robust_helper(X = X, y = dat$y, type = "HC0")))
# system.time(replicate(500, lm_robust_helper(X = X, y = dat$y, type = "HC1")))
# system.time(replicate(500, lm_robust_helper(X = X, y = dat$y, type = "HC2")))
# system.time(replicate(500, lm_robust_helper(X = X, y = dat$y, type = "HC3")))
#
#

Try the estimatr package in your browser

Any scripts or data that you put into this service are public.

estimatr documentation built on May 29, 2024, 7:23 a.m.