opl_dt_c

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(OPL)

Introduction

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.

Usage

opl_dt_c(make_cate_result,z,w,c1=NA,c2=NA,c3=NA)

Output

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.

Details

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

# 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()

Interpretation of Results

References


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.

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.



Try the OPL package in your browser

Any scripts or data that you put into this service are public.

OPL documentation built on April 4, 2025, 3:09 a.m.