help make_cate

Title

make_cate -- Predicting conditional average treatment effect (CATE) on a new policy based on the training over an old policy

Syntax

make_cate
outcome
features ,
treatment(varname)
new_cate(name)
train_cate(name)
new_data(name)
[model(model_type)
type(algorithm_type)]

Inputs

outcome: numerical variable

features: list of numerical variables representing the features.

Description

make_cate is a command generating conditional average treatment effect (CATE) for both a training dataset and a testing (or new) dataset related to a binary (treated vs. untreated) policy program. make_cate uses two distinct algorithms to estimate CATE: (i) the Regression Adjustment (or T-Learner) (Kunzel et al., 2019), and (ii) the Cross-Fitting Augmented Inverse Probability Weighting (CF-AIPW), which has the double-robust property (Kennedy, 2023). make_cate provides the main input for running opl_tb (optimal policy learning of a threshold-based policy), opl_tb_c (optimal policy learning of a threshold-based policy at specific thresholds), opl_lc (optimal policy learning of a
linear-combination policy), opl_lc_c (optimal policy learning of a linear-combination policy at specific parameters), opl_dt (optimal policy learning of a decision-tree policy), opl_dt_c (optimal policy learning of a decision-tree policy at specific thresholds and selection variables). Based on Kitagawa and Tetenov (2018), the main econometrics supported by these commands can be found in Cerulli (2022).

Options

options

treatment(varname) defines the treatment variable adopted in the old (ex-post) policy run. It must be a 0/1 dummy (1=treated; 0=untreated).

new_data(name) indicates by name the dataset stored in the home directory containing the data of the new policy run (i.e., the features of the would-be beneficiaries).

new_cate(name) indicates by name the variable that will be generated containing the prediction over new_data of the conditional average treatment effect (CATE).

train_cate(name) indicates by name the variable that will be generated containing the prediction over the training dataset of the conditional average treatment effect (CATE).

model(model_type) indicates the treatment model used for estimating and predicting the conditional average treatment effect (CATE) when the algorithm used is Regression Adjustment (T-Learner). The implemented estimation methods are linear and non-linear regression adjustment. As model_type, use the following options: "linear", if the outcome variable is gaussian (numerical and continuous);
"logit", if the outcome variable is binary (0/1); "poisson", if the outcome variable is countable; "flogit", if the outcome variable is fractional.

type(algorithm_type) specifies the algorithm used to estimate the conditional average treatment effects (CATE). There are two available options: (i) "ra", implementing the Regression Adjustment (or T-Learner), and (ii) "dr", implementing the Cross-Fitting Augmented Inverse Probability Weighting (CF-AIPW), which has the double-robust property (hence the acronym "dr"). CF-AIPW always assumes a continuous outcome, thus no model options are specified in this case.

Returns

Macros
e(cate_new) Name of the CATE in the new policy data

e(cate_train) Name of the CATE in the old (training) policy data

Variables
_train_new_index Flag variable indicating the training (i.e., old-policy) and the new-policy observations

cate_train Variable containing training (i.e., old-policy) predictions for CATE

cate_new Variable containing new (i.e., new-policy) predictions for CATE

Remarks

Remark 1. Please, consider to keep updated with future versions of this command.

Example

Example: Predicting CATE for a binary policy

Load initial dataset

sysuse JTRAIN2, clear

Split the original data into a "old" (training) and "new" (testing) dataset

get_train_test, dataname(jtrain) split(0.60 0.40) split_var(svar) rseed(101)

Use the "old" dataset (i.e. policy) for training

use jtrain_train , clear

Set the outcome

global y "re78"

Set the features

global x "re74 re75 age agesq nodegree"

Set the treatment variable

global w "train"

Set the selection variables

global z "age mostrn"

Run "make_cate" and generate training (old policy) and testing (new policy) CATE predictions

make_cate $y $x , treatment($w) type("ra") model("linear") new_cate("my_cate_new") train_cate("my_cate_train") new_data("jtrain_test")

References

Athey, S., and Wager S. 2021. Policy Learning with Observational Data, Econometrica, 89, 1, 133–161.

Cerulli, G. 2021. Improving econometric prediction by machine learning, Applied Economics Letters, 28, 16, 1419-1425.

Cerulli, G. 2022. Optimal treatment assignment of a threshold-based policy: empirical protocol and related issues, Applied Economics Letters, 30, 8, 1010-1017.

Cerulli, G. 2023. Fundamentals of Supervised Machine Learning: With Applications in Python, R, and Stata, Springer, 2023.

Gareth, J., Witten, D., Hastie, D.T., Tibshirani, R. 2013. An Introduction to Statistical Learning : with Applications in R. New York, Springer.

Kennedy, E. H. 2023. Towards optimal doubly robust estimation of heterogeneous causal effects. Electronic Journal of Statistics, 17, 2, 3008-3049.

Kitagawa, T., and A. Tetenov. 2018. Who Should Be Treated? Empirical Welfare Maximization Methods for Treatment Choice, Econometrica, 86, 2, 591–616.

Kunzel, S. R., Sekhon, J. S., Bickel, P. J., Yu, B. (2019). Metalearners for estimating heterogeneous treatment effects using machine learning.
Proceedings of the National Academy of Sciences of the United States of America, 116, 10, 4156-4165.

Acknowledgment

The development of this software was supported by FOSSR (Fostering Open Science in Social Science Research), a project funded by the European Union - NextGenerationEU under the NPRR Grant agreement n. MURIR0000008.

Author

Giovanni Cerulli

IRCrES-CNR

Research Institute for Sustainable Economic Growth, National Research Council of Italy

E-mail: giovanni.cerulli@ircres.cnr.it

Also see

Online: opl_tb, opl_tb_c, opl_lc, opl_lc_c, opl_dt, opl_dt_c