help opl_lc_c

Title

opl_lc_c -- Linear-combination policy learning at specific parameters' values

Syntax

opl_lc_c ,
xlist(var1 var2)
cate(varname)
c1(number)
c2(number)
c3(number)
[
depvar(name)
graph
]

Description

opl_lc_c is a command implementing ex-ante treatment assignment using as policy
class a linear-combination approach at specific parameters' values c1, c2, and c3
for the linear-combination of variables var1 and var2: c1*var1+c2*var2=c3.

Options

options

xlist(var1 var2) defines the two variables the policymaker decide to use for selecting policy beneficiaries.

cate(varname) puts into varname a variable already present in the dataset containing the conditional average treatment effect (CATE). This variable can be generated using the command make_cate.

c1(number) puts into number the value of the parameter value c1 for the first selection variable. This number must be chosen between 0 and 1.

c2(number) puts into number the value of the parameter value c2 for the second selection variable. This number must be chosen between 0 and 1.

c3(number) puts into number the value of the parameter value c3 of the linear-combination. This number must be chosen between 0 and 1.

depvar(name) assigns the specified name to the dependent variable for display in the results table. While this option does not impact computations, it ensures a meaningful label for the dependent variable in the results table.

graph visualizes treated and untreated within the var1 and var2 quadrant.

Returns

Scalars
e(c1) Parameter of var1 in the linear-combination

e(c2) Parameter of var2 in the linear-combination

e(c3) Third parameter of the linear-combination

e(W_unconstr) Value of the unconstrained welfare at parameters' values c1, c2, and c3

e(W_constr) Value of the constrained welfare at parameters' values c1, c2, and c3

e(perc_treat) Percentage over the entire sample of the beneficiaries to treat at parameters' values c1, c2, and c3

Variables
_units_to_be_treated Flag variable indicating the policy beneficiaries at parameters' values c1, c2, and c3

Remarks

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

Example

Example: Linear-combination policy learning at specific parameters' values

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) model("linear") new_cate("my_cate_new") train_cate("my_cate_train") new_data("jtrain_test")

Generate a global macro containing the name of the variable "cate_new"

global T `e(cate_new)'

Select only the "new data"

keep if _train_new_index=="new"

Drop "my_cate_train" as in the new dataset treatment assignment and outcome performance are unknown

drop my_cate_train $w $y

Run "opl_lc" to find the optimal linear-combination parameters

opl_lc , xlist($z) cate($T)

Save the optimal linear-combination parameters into three global macros

global c1_opt=e(best_c1)

global c2_opt=e(best_c2)

global c3_opt=e(best_c3)

Run "opl_lc_c" at optimal linear-combination parameters and generate the graph

opl_lc_c , xlist($z) cate($T) c1($c1_opt) c2($c2_opt) c3($c3_opt) graph depvar("re78")

Tabulate the variable "_units_to_be_treated"

tab _units_to_be_treated , mis

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.

Cerulli, G. 2024. Optimal Policy Learning using Stata. Zenodo. DOI: https://doi.org/10.5281/zenodo.10822240.

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

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

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: make_cate, opl_tb, opl_lc, opl_lc_c, opl_dt, opl_dt_c