consistcv.test: The Consistency Test for Grouped Average Treatment Effects...

View source: R/consistcv.test.R

consistcv.testR Documentation

The Consistency Test for Grouped Average Treatment Effects (GATEs) under Cross Validation in Randomized Experiments

Description

Tests whether treatment effects are nondecreasing across cross-validated score groups.

Usage

consistcv.test(D, tau, Y, ind, ngates = 5, nsim = 10000, centered = TRUE)

Arguments

D

Binary treatment indicator (0 or 1).

tau

A matrix of scores with one column per fold. Column i contains predictions for all observations from a model trained without fold i.

Y

Outcome vector.

ind

Integer validation-fold labels starting at 1.

ngates

Number of groups (at least 2).

nsim

Number of Monte Carlo draws (at least 2).

centered

Whether to center outcomes before estimation.

Details

Uses consistcv.test for inference.

Value

A list with test statistic stat and p-value pval.

Author(s)

Michael Lingzhi Li, Technology and Operations Management, Harvard Business School mili@hbs.edu, https://www.michaellz.com/;

References

Imai and Li (2022). “Statistical Inference for Heterogeneous Treatment Effects Discovered by Generic Machine Learning in Randomized Experiments”,

Examples

D = c(1,0,1,0,1,0,1,0)
tau = matrix(c(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,-0.5,-0.3,-0.1,0.1,0.3,0.5,0.7,0.9),nrow = 8, ncol = 2)
Y = c(4,5,0,2,4,1,-4,3)
ind = c(rep(1,4),rep(2,4))
consisttestlist <- consistcv.test(D,tau,Y,ind,ngates=2)
consisttestlist$stat
consisttestlist$pval

evalHTE documentation built on Sept. 7, 2026, 9:06 a.m.