opl_lc_c

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

Introduction

The opl_lc_c function implements ex-ante treatment assignment using as policy class a fixed-depth (1-layer) decision-tree at specific splitting variables and threshold values.

Usage

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

Arguments

Output

The function returns the input data frame augmented with: - treatment_assignment: Binary indicator for treatment assignment based on policy learning. - policy_summary: Summary statistics detailing the constrained optimization results.

Additionally, the function: - Prints a summary of key results, including welfare improvements under the learned policy. - Displays a visualization of the treatment allocation.

Details

The function follows these steps: 1. Estimates the optimal policy assignment using a machine learning-based approach. 2. Incorporates policy constraints to balance fairness, budget, or other practical limitations. 3. Computes and reports key statistics, including constrained welfare gains and proportion of treated units.

Example

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

# Define policy constraints
constraints <- list(budget = 0.5)  # Example: treating at most 50% of units

# Run learning-based constrained policy assignment
result <- opl_lc_c(
  make_cate_result = data_example,
  w = "treatment",
  policy_constraints = constraints
)

Interpretation of Results

References


This vignette provides an overview of the opl_lc_c function and demonstrates its usage for learning-based constrained policy assignment. 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.