CATEs
Machine Learning Estimation of Heterogeneous Causal Effects
Install / Use
/learn @MCKnaus/CATEsREADME
CATEs
Implementation of all estimators that are applied in the Empirical Monte Carlo Study of Knaus, Lechner and Strittmatter (2018). They are based on the packages grf and glmnet.
Example
We have no permission to share the data used in the study. Therefore, the following example uses the observational data generating process of the example of grf to illustrate how it works. The function IATEs is a wrapper for the underlying functions and uses all the default settings of the packages. If you want to have more control over the settings, use the respective functions in CATEs_utils.
# Download current version from Github
library(devtools)
install_github(repo="MCKnaus/CATEs")
library(CATEs)
# Generate training sample
n = 4000; p = 20
x_tr = matrix(rnorm(n * p), n, p)
tau_tr = 1 / (1 + exp(-x_tr[, 3]))
d_tr = rbinom(n ,1, 1 / (1 + exp(-x_tr[, 1] - x_tr[, 2])))
y_tr = pmax(x_tr[, 2] + x_tr[, 3], 0) + rowMeans(x_tr[, 4:6]) / 2 + d_tr * tau_tr + rnorm(n)
# Generate validation sample of same size
x_val = matrix(rnorm(n * p), n, p)
tau_val = 1 / (1 + exp(-x_val[, 3]))
# Apply all estimators to the training sample and predict IATEs for validation sample
iates_mat = IATEs(y_tr,d_tr,x_tr,tau_tr,x_val)
# Calculate and print mean MSEs
mMSE = colMeans((iates_mat - tau_val)^2)
names(mMSE) = colnames(iates_mat)
mMSE*1000
References
Knaus, Lechner, Strittmatter (2021). Machine Learning Estimation of Heterogeneous Causal Effects: Empirical Monte Carlo Evidence, The Econometrics Journal, arXiv
Related Skills
proje
Interactive vocabulary learning platform with smart flashcards and spaced repetition for effective language acquisition.
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
groundhog
401Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
