library(lava)
n <- 300
d <- data.frame(x = rnorm(n), a = rbinom(n, 1, 0.5), y = rnorm(n))
est <- targeted::cate(y ~ a * x, a ~ 1, data = d)
f <- function(p) p["E[y(1)]"] - p["E[y(0)]"]
e0 <- estimate(est, f = f)
e1 <- estimate(est, f = f, type = "HC3")
e0$coefmat == e1$coefmat # type argument has no effect
e2 <- estimate(est, f = f) |> estimate(type = "HC3")
e0$coefmat == e2$coefmat # works now
@kkholst, we should discuss whether we want to fix this or if we should otherwise simply cast a warning when both
fandtypeare supplied.