knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(OPL)
The opl_dt_c
function implements ex-ante treatment assignment using as
policy class a 2-layer fixed-depth decision-tree at specific
splitting variables and threshold values.
opl_dt_c(make_cate_result,z,w,c1=NA,c2=NA,c3=NA)
The function performs the following steps: - Standardizes threshold variables to the [0,1] range. - Determines optimal policy assignment using a constrained decision tree approach. - Computes and reports key statistics, including welfare gains and percentage of treated units. - Generates a visualization of the optimal policy assignment.
The opl_dt_c
function follows these steps:
1. Standardizes selection variables.
2. Implements a grid search over threshold values.
3. Identifies the optimal constrained policy maximizing welfare.
4. Computes summary statistics and visualizes treatment assignment.
# Example data data_example <- data.frame( my_cate = runif(100, -1, 1), X1 = runif(100, 0, 1), X2 = runif(100, 0, 1), treatment = sample(0:1, 100, replace = TRUE) ) # Run the decision tree-based policy learning function opl_dt_c()
This vignette provides an overview of the opl_dt_c
function and demonstrates its usage for decision tree-based policy learning. For further details, consult the package documentation.
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.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.