{smcl} {* 31aug2026}{...} {cmd:help opl_policy_eval} {hline} {title:Title} {p2colset 5 18 22 2}{...} {p2col :opl_policy_eval {hline 1}} Evaluate a user-supplied binary treatment policy after {cmd:opl_tb_cba} {p2colreset}{...} {title:Syntax} {p 8 8} {cmd:opl_policy_eval} {it:policyvar} {pstd} where {it:policyvar} is a numeric binary variable coded 1 for treated observations and 0 for untreated observations. {dlgtab:Description} {pstd} {cmd:opl_policy_eval} evaluates a user-supplied binary treatment policy after {helpb opl_tb_cba}. The command uses the treatment-effect variable, treatment cost, cost-weight parameter, and estimation sample stored by {cmd:opl_tb_cba}. {pstd} For a policy indicator {it:D_i}, the command computes treatment coverage, total treatment benefit, total treatment cost, and weighted social surplus: {p 12 12} Q(D;lambda) = sum_i D_i tau_i - lambda sum_i D_i c_i. {pstd} Here, {it:tau_i} is the estimated individual treatment effect, {it:c_i} is the individual treatment cost, and {it:lambda} is inherited from the preceding {cmd:opl_tb_cba} estimation. {pstd} The evaluation sample is the estimation sample from {cmd:opl_tb_cba}, excluding observations with missing values in the policy, treatment-effect, or cost variables. {pstd} {cmd:opl_policy_eval} may be used to evaluate externally defined policies, benchmark policies, or policy variables generated by {cmd:opl_tb_cba}, such as the estimated optimal threshold policy and the first-best policy. {dlgtab:Requirements} {phang} {cmd:opl_policy_eval} must be run after {helpb opl_tb_cba}. The preceding command must store {cmd:e(tauvar)}, {cmd:e(costvar)}, {cmd:e(lambda)}, and {cmd:e(sample)}. {phang} {it:policyvar} must be numeric and must contain only 0 and 1 in the evaluation sample. {phang} Observations with missing values in {it:policyvar}, the treatment-effect variable, or the cost variable are excluded from evaluation. {dlgtab:Policy evaluation measures} {pstd} The command computes the following quantities: {synoptset 22 tabbed} {synopt:{cmd:N}}number of observations in the evaluation sample{p_end} {synopt:{cmd:N_treated}}number assigned to treatment{p_end} {synopt:{cmd:N_untreated}}number assigned to no treatment{p_end} {synopt:{cmd:coverage}}share of the evaluation sample assigned to treatment{p_end} {synopt:{cmd:total_benefit}}sum of estimated treatment effects among treated observations{p_end} {synopt:{cmd:total_cost}}sum of treatment costs among treated observations{p_end} {synopt:{cmd:Q}}weighted social surplus{p_end} {synopt:{cmd:ATET}}average estimated treatment effect among treated observations{p_end} {synopt:{cmd:avg_cost}}average treatment cost among treated observations{p_end} {synopt:{cmd:avg_surplus}}average weighted surplus among treated observations{p_end} {pstd} Treatment coverage is {p 12 12} coverage = N_treated / N. {pstd} Weighted social surplus is {p 12 12} Q = total benefit - lambda x total cost. {pstd} Average surplus is defined as {p 12 12} average surplus = Q / N_treated. {pstd} If the policy assigns no observations to treatment, total benefit, total cost, and total welfare are set to zero, while ATET, average cost, and average surplus are returned as missing. {dlgtab:Stored results} {pstd} {cmd:opl_policy_eval} is {cmd:rclass} and stores the following results: {synoptset 32 tabbed} {synopt:{cmd:r(N)}}number of observations in the evaluation sample{p_end} {synopt:{cmd:r(N_treated)}}number assigned to treatment{p_end} {synopt:{cmd:r(N_untreated)}}number assigned to no treatment{p_end} {synopt:{cmd:r(coverage)}}treatment coverage{p_end} {synopt:{cmd:r(total_benefit)}}total treatment benefit{p_end} {synopt:{cmd:r(total_cost)}}total treatment cost{p_end} {synopt:{cmd:r(Q)}}weighted social surplus{p_end} {synopt:{cmd:r(ATET)}}average treatment effect among treated observations{p_end} {synopt:{cmd:r(avg_cost)}}average treatment cost among treated observations{p_end} {synopt:{cmd:r(avg_surplus)}}average weighted surplus among treated observations{p_end} {synopt:{cmd:r(policy)}}evaluated policy variable{p_end} {synopt:{cmd:r(tauvar)}}treatment-effect variable inherited from {cmd:opl_tb_cba}{p_end} {synopt:{cmd:r(costvar)}}cost variable inherited from {cmd:opl_tb_cba}{p_end} {dlgtab:Remarks} {pstd} {cmd:opl_policy_eval} does not estimate a treatment policy. It evaluates an existing binary policy using the treatment-effect and cost information stored by the latest {cmd:opl_tb_cba} estimation. {pstd} The command evaluates the policy on the original estimation sample. It does not permit an independent {cmd:if} or {cmd:in} restriction. {pstd} The reported ATET is the average estimated treatment effect among observations assigned to treatment by the evaluated policy. It should therefore be interpreted as a policy-specific average treatment effect among the treated. {pstd} Because {cmd:lambda} is inherited from {cmd:opl_tb_cba}, all policies evaluated after the same estimation are compared using the same cost-benefit criterion. {dlgtab:Examples} {pstd} Estimate a threshold-based policy before evaluating alternative binary policies: {phang2} {stata "sysuse data_opl_tb_cba_2, clear"} {phang2} {stata "opl_tb_cba tau, cost(cost) select(x1 x2) lambda(1) npoints(51) custompolicy(D) custom(.30 .30) generate(opl2) replace"} {pstd} Evaluate an externally defined policy: {phang2} {stata "opl_policy_eval D"} {pstd} Evaluate the optimal threshold policy generated by {cmd:opl_tb_cba}: {phang2} {stata "opl_policy_eval opl2_opt"} {pstd} Evaluate the first-best policy generated by {cmd:opl_tb_cba}: {phang2} {stata "opl_policy_eval opl2_fb"} {pstd} Inspect the returned results after any evaluation: {phang2} {stata "return list"} {dlgtab:Acknowledgment} {pstd} 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. {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 "giovanni.cerulli@cnr.it"}{p_end} {dlgtab:Also see} {psee} Online: {helpb opl} {p_end}