if ( torch::torch_is_installed() ){
# set-up data
data <- Hainmueller$new()
data$gen_data()
# calculate quantities
weight <- calc_weight(data, method = "COT",
estimand = "ATT",
options = list(lambda = 0))
tx_eff <- estimate_effect(causalWeights = weight)
# get estimate
print(tx_eff@estimate)
all.equal(coef(tx_eff), c(estimate = tx_eff@estimate))
}
Run the code above in your browser using DataLab