Software

cmrdesign

R on CRAN Python on PyPI

cmrdesign is an R and Python package that implements the design rules from When and How to Pilot. Given pilot outcomes and treatment assignments, it recommends how to split the main experiment between treatment and control. It also reports a finite-sample bound on how much precision that split can lose relative to the best allocation.

In these examples, y contains pilot outcomes and d contains treatment assignments.

R

install.packages("cmrdesign")
library(cmrdesign)
fit <- cmr_two_arm(
  y, d, alpha = 0.05, method = "auto"
)
fit$pi     # share of the main wave to treat
fit$U_CMR  # bound on precision lost vs. best split

Python

python -m pip install cmrdesign
import cmrdesign as cmr
fit = cmr.cmr_two_arm(
  y, d, alpha=0.05, method="auto"
)
fit.pi     # share of the main wave to treat
fit.U_CMR  # bound on precision lost vs. best split