*! opl_best_treat, v5, GCerulli, 29aug2025

Title

opl_best_treat -- Computing maximal reward and best treatment after opl_ma_fb.

Syntax

opl_best_treat varlist

where:

varlist are the reward counterfactual predictions obtained after estimating opl_ma_fb, that is: __pred0, __pred1, __pred2, etc..

Description

opl_best_treat is used after running opl_ma_fb and loading the dataset saved via
option save_preds_vars(name) of opl_ma_fb, which stores individual-level
counterfactual expected rewards and conditional variances.

Given the counterfactual predictions in varlist (one variable per treatment arm,
e.g. __pred0, __pred1, __pred2, ...), opl_best_treat computes:
(1) the maximal expected outcome across arms, and
(2) the corresponding best treatment, according to the first-best decision rule.

Options

None. The command takes only varlist as input.

Returned variables

__Y_hat_max: maximal expected outcome over the treatments in varlist.

__T_best: index of the best (optimal) treatment achieving __Y_hat_max
(first-best rule).

Remarks

opl_best_treat assumes that all variables in varlist are on the same outcome scale and
correspond to mutually exclusive treatment arms with consistent naming (e.g., __pred0, __pred1, ...).
The command does not alter the input predictions.

Examples

* After running opl_ma_fb with option save_preds_vars() and loading the saved dataset:

. describe __pred0 __pred1 __pred2

. opl_best_treat __pred0 __pred1 __pred2

. summarize __Y_hat_max

. tabulate __T_best

Author

Giovanni Cerulli

IRCrES-CNR

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

E-mail: giovanni.cerulli@cnr.it

Also see:

opl_ma_fb, opl_ma_vf, opl_plot_best