{smcl} {* *! opl_plot_best, v5, GCerulli, 11aug2025} {title:Title} {pstd} {cmd:opl_plot_best} {hline 2} Plot observed versus the maximal expected reward, observed versus optimal treatment. {marker syntax}{...}{title:Syntax} {p 8 17 2} {cmd:opl_plot_best} {it:varlist} [{cmd:,} {opt gr_reward_train(name)} {opt gr_action_train(name)}] were: {pstd} {it:varlist} must be an ordered list of {bf:four} variables: {p 8 12 2} (1) the expected outcome (based on the training policy);{p_end} {p 8 12 2} (2) the observed treatment (i.e., the training policy);{p_end} {p 8 12 2} (3) the maximal expected outcome (based on the best policy);{p_end} {p 8 12 2} (4) the best treatment (i.e., the optimal policy).{p_end} {marker description}{title:Description} {pstd} After running {cmd:opl_best_treat}, the command {cmd:opl_plot_best} plots observed versus the maximal expected reward, and observed versus optimal treatment, using the variables generated by {cmd:opl_best_treat}. {p_end} {marker options}{title:Options} {phang} {opt gr_reward_train(name)} saves the reward plot (observed outcome vs. maximal expected outcome) to a graph named {it:name} in the current working directory. {phang} {opt gr_action_train(name)} saves the action plot (observed treatment vs. optimal treatment) to a graph named {it:name} in the current working directory. {marker remarks}{title:Remarks} {pstd} The command assumes that the four variables in {it:varlist} appear in the exact order listed above. Results are typically generated by {cmd:opl_best_treat} and then passed to {cmd:opl_plot_best}. {p_end} {marker example}{title:Examples} {phang}* After {cmd:opl_best_treat} has produced the needed variables:{p_end} {phang}{cmd:.opl_plot_best} y obs_treat y_max t_best{p_end} {phang}* Save both graphs:{p_end} {phang}{cmd:.opl_plot_best} y obs_treat y_max t_best, gr_reward_train(reward_train) gr_action_train(action_train){p_end} {dlgtab:Author} {phang}Giovanni Cerulli{p_end} {phang}IRCrES-CNR{p_end} {phang}Research Institute for Sustainable Economic Growth, National Research Council of Italy{p_end} {phang}E-mail: {browse "mailto:giovanni.cerulli@cnr.it":giovanni.cerulli@cnr.it}{p_end} {dlgtab:Also see:} {psee} {help opl_ma_fb}, {help opl_ma_vf}, {help opl_best_treat}{p_end}