opl_tb_c

library(OPL)

Introduction

The opl_tb_c function implements ex-ante treatment assignment using as policy class a threshold-based (or quadrant) approach at specific threshold values c1 and c2 for respectively the selection variables var1 and var2.

Usage

opl_tb_c(make_cate_result, z, w, c1 = NA, c2 = NA)

Arguments

Output

The function returns the input data frame augmented with: - z[1]_std: Standardized first selection variable. - z[2]_std: Standardized second selection variable. - units_to_be_treated: Binary indicator for treatment assignment.

Additionally, the function: - Prints a summary of key results, including threshold values, constrained and unconstrained welfare, and treatment proportions. - Displays a scatter plot visualizing the policy assignment.

Details

The function follows these steps: 1. Standardizes the selection variables to a [0,1] range. 2. Identifies the optimal thresholds using grid search to maximize constrained welfare. 3. Computes and reports key statistics, including average welfare and percentage of treated units.

Example

# Load example data
set.seed(123)
data_example <- data.frame(
  my_cate = runif(100, -1, 1),
  var1 = runif(100, 0, 1),
  var2 = runif(100, 0, 1),
  treatment = sample(0:1, 100, replace = TRUE)
)

# Run threshold-based policy learning
result <- opl_tb_c(
  make_cate_result = data_example,
  z = c("var1", "var2"),
  w = "treatment"
)

Interpretation of Results

References


This vignette provides an overview of the opl_tb_c function and demonstrates its usage for threshold-based policy learning. For further details, consult the package documentation.