Skip to content

cjerzak/strategize-software

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strategize: An R package for discovering optimal treatment strategies in high-dimensional data

Demo Button

Software for implementing optimal stochastic intervention analysis. Current implementation handles conjoint data from experiments. Future work may also include text, network, and time series data, with observational designs potentially supported.

Installation

The most recent version of strategize can be installed directly from the repository using the devtools package

devtools::install_github("cjerzak/strategize-software/strategize")

The package can then be loaded into your R session like so:

library(strategize)

Package functions can also be accessed as strategize::function_name.

Tutorial

Below is a minimal example demonstrating how to discover an optimal set of factor‐level probabilities for a simple conjoint design. Because the package does not ship with data, we begin by simulating a small dataset.

set.seed(123)

# Example data with two factors and a binary outcome
n <- 200
W <- data.frame(
  sex   = sample(c("Male", "Female"), n, replace = TRUE),
  party = sample(c("A", "B"),       n, replace = TRUE)
)
Y <- rbinom(n, 1, 0.5)

# Original (uniform) assignment probabilities for each factor
p_list <- list(
  sex   = c(Male = 0.5, Female = 0.5),
  party = c(A = 0.5,   B = 0.5)
)

# Search for a probability distribution that maximizes the expected outcome
library(strategize)
fit <- cv_strategize(
  Y = Y,
  W = W,
  p_list = p_list,
  lambda = 0.1,
  nSGD = 100,
  adversarial = FALSE
)

# Optimized factor-level probabilities and predicted outcome
fit$PiStar_point
fit$Q_point_mEst

This script simulates a two-factor forced-choice design, fits the model, and returns PiStar_point, the recommended distribution over factor levels, along with the expected outcome Q_point_mEst under that distribution.

License

GPL-3.

References

Jerzak, Connor T., Priyanshi Chandra, and Rishi Hazra. 2025. "Selecting Optimal Candidate Profiles in Adversarial Environments Using Conjoint Analysis and Machine Learning." arXiv preprint arXiv:2504.19043. https://arxiv.org/abs/2504.19043.

@misc{jerzak2025selectingoptimalcandidateprofiles,
      title={Selecting Optimal Candidate Profiles in Adversarial Environments Using Conjoint Analysis and Machine Learning},
      author={Connor T. Jerzak and Priyanshi Chandra and Rishi Hazra},
      year={2025},
      eprint={2504.19043},
      archivePrefix={arXiv},
      primaryClass={stat.ME},
      url={https://arxiv.org/abs/2504.19043}, 
}

About

strategize: An R package for performing optimal stochastic intervention analysis

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages