Software

Computational implementations of methods from recent research. Packages cover cluster-robust inference, partial identification via moment inequalities, and regression discontinuity design. Distributions span Stata, R, MATLAB, and Python. All code is open source.

Stata R MATLAB Python GitHub CRAN MIT License

Approximate Randomization Tests

Inference on regression coefficients when the number of treated clusters is small. The approach approximates the finite-sample null distribution using random sign changes, yielding valid tests without asymptotics in the number of clusters.

Stata R

arts

Approximate Randomization Tests for inference with few treated clusters

Implements the tests developed in Canay, Romano, and Shaikh (2017) and extended in Cai, Canay, Kim, and Shaikh (2021) to accommodate wild bootstrap critical values. Designed for settings where few clusters receive treatment and standard cluster-robust standard errors are unreliable. Available as a Stata module (arts-stata) and an R package (rART).

install · R
remotes::install_github("iacanay/rART")

Moment Inequalities

Code companion to a User's Guide covering inference in partially identified models defined by moment inequalities. Organized by inference method, with implementations in three environments.

MATLAB Python R

guide-inequalities

Code for A User's Guide to Approximate Partial Identification via Moment Inequalities

Replicates all examples and simulations in Canay, Illanes, and Vélez (2023), a practical reference for researchers applying moment inequality methods. The repository is organized by inference procedure and covers confidence sets, hypothesis tests, and sensitivity analyses under a range of moment inequality models. Code in MATLAB, Python, and R mirrors the paper section by section.

Regression Discontinuity

Permutation- and randomization-based tests for the key identifying assumptions in regression discontinuity designs: continuity of covariates and continuity of the running variable's density at the cutoff.

R CRAN

RATest

Randomization tests for RDD covariate continuity, with a permutation-based approach

A collection of randomization-based inference procedures for regression discontinuity designs. The core function implements the permutation test of covariate continuity at the cutoff from Canay and Kamat (2018). The test makes no functional-form assumptions on the conditional distributions of covariates and is valid under weak regularity conditions. Available on CRAN.

install · R / CRAN
install.packages("RATest")
Stata

rdperm

Permutation test of covariate continuity at the RDD cutoff

Stata implementation of the permutation test in Canay and Kamat (2018). Tests whether predetermined covariates are continuously distributed at the running variable threshold, without imposing smoothness assumptions on the conditional distributions.

Stata

rdcont

Test of density continuity of the running variable at the RDD cutoff

Stata implementation of the test in Canay, Miki, and Shaikh (2021). Tests the continuity of the running variable's marginal density at the threshold, a key identifying assumption in RDD that is distinct from the McCrary (2008) manipulation test.

Randomized Experiments

Regression-based estimators and inference procedures for randomized controlled experiments with covariate-adaptive randomization, where treatment assignment is stratified by baseline covariates.

Stata

car

Linear regression with strata fixed effects for covariate-adaptive randomized trials

Implements the methods in Bugni, Canay, and Shaikh (2018, 2019) for analyzing randomized experiments in which treatment is assigned through a stratified randomization scheme. Provides OLS estimators that properly account for the strata structure, yielding valid inference on average treatment effects under covariate-adaptive randomization with a fixed number of strata and multiple treatments.