help opl_budget

Title

opl_budget - Optimal policy learning under budget constraint and minimum number of treated units

Syntax

opl_budget tauvar costvar ,
budget(#)
nmin(#)
em0(#)
[policy(name) replace custom_pol(varname)]

where:

tauvar: estimated individual treatment effects (CATE or τ̂_i)

costvar: individual treatment costs

Description

opl_budget assigns binary treatment optimally under two constraints:
(1) a total budget limit, and (2) a minimum number of individuals to treat.
Individuals are ranked by cost-effectiveness (τ̂_i / cost_i). The optimizer
selects the cutoff k* that maximizes cumulative welfare while satisfying
both constraints.

The option em0(#) supplies the baseline outcome/welfare E[m0(X)],
so that the command can report both incremental welfare
(sum of τ̂_i over treated units) and total welfare
(E[m0(X)] + sum τ̂_i).

In addition to estimating the optimal policy, the command can also
evaluate a user-defined policy via the option
custom_pol(varname), which must be a 0/1 variable.
For this customized policy, the command computes welfare, treatment
coverage, and total cost, and returns them in r().

Estimated individual treatment effects (CATEs) may be obtained, for example, using
the make_cate command.

Options

budget(#) total available budget (positive)

nmin(#) minimum number of treated individuals

em0(#) baseline welfare E[m0(X)] for computing total welfare

policy(name) name of the generated optimal policy variable
(default: opl_policy)

replace overwrite the policy variable if it exists

custom_pol(varname) evaluate a user-defined 0/1 treatment policy;
returns welfare, cost, and coverage for the supplied policy

Returned values

The command is rclass and returns:

r(budget) total budget

r(kstar) optimal cutoff k*

r(welfare_incr) incremental welfare (sum of τ̂_i over optimally treated)

r(welfare_tot) total welfare = em0 + sum(τ̂_i)

r(cost) total treatment cost under the optimal policy

r(Ntreated) number of units treated under the optimal policy

r(Ptreated) percentage treated under the optimal policy

If custom_pol() is specified, the following are additionally returned:

r(cust_welfare_incr) incremental welfare under the custom policy

r(cust_welfare_tot) total welfare under the custom policy (em0 + incremental)

r(cust_cost) treatment cost under the custom policy

r(cust_Ntreated) number treated under the custom policy

r(cust_Ptreated) percentage treated under the custom policy

Remarks

The estimator uses a greedy, cost-effectiveness–based optimization procedure.
It guarantees feasibility with respect to both budget and minimum–treated constraints.
Comparison with alternative user-defined policies is possible via custom_pol().

Example

Example: Budget-constrained optimal policy learning with a custom policy evaluation

Clear the Stata environment

clear all

Load initial dataset

sysuse JTRAIN2

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

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

Use the training dataset

use jtrain_train , clear

Define outcome, features, treatment, and selection variables

replace re78 = re78 * 1000

global y "re78"

global x "re74 re75 age agesq nodegree"

global w "train"

Estimate CATEs on training and testing samples using make_cate

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

Store E[m0(X)] from the training sample and clean unnecessary variables

global Em0_train = e(Em0_train)

drop my_cate_new

keep if my_cate_train != .

Define individual treatment costs

generate cost = 1000 + 50 * age

Use as custom policy the training policy

gen mypolicy = train

Set total budget and minimum number of treated units

global B = 80000

global N_min = 20

Run opl_budget to compute the optimal policy and evaluate the custom policy

opl_budget my_cate_train cost, budget($B) nmin($N_min) em0($Em0_train) policy(pol_opt) custom_pol(mypolicy) replace

Inspect returned results

return list

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: mailto:giovanni.cerulli@ircres.cnr.it

Also see

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