We introduce the Stata package Binsreg, which implements the binscatter methods developed in Cattaneo, Crump, Farrell and Feng (2023a,b). The package includes seven commands: binsreg, binslogit, binsprobit, binsqreg, binstest, binspwc, and binsregselect. The first four commands implement point estimation and uncertainty quantification (confidence intervals and confidence bands) for canonical and extended least squares binscatter regression (binsreg) as well as generalized nonlinear binscatter regression (binslogit for Logit regression, binsprobit for Probit regression, and binsqreg for quantile regression). These commands also offer binned scatter plots, allowing for one- and multi-sample settings. The next two commands focus on pointwise and uniform inference: binstest implements hypothesis testing procedures for parametric specifications and for nonparametric shape restrictions of the unknown regression function, while binspwc implements multi-group pairwise statistical comparisons. These two commands cover both least squares as well as generalized nonlinear binscatter methods. All our methods allow for multi-sample analysis, which is useful when studying treatment effect heterogeneity in randomized and observational studies. Finally, the command binsregselect implements data-driven number of bins selectors for binscatter methods using either quantile-spaced or evenly-spaced binning/partitioning. All the commands allow for covariate adjustment, smoothness restrictions, weighting and clustering, among many other features. Companion Python and R packages with similar syntax and capabilities are also available.
翻译:本文介绍 Stata 包 Binsreg,该包实现了 Cattaneo、Crump、Farrell 和 Feng (2023a,b) 开发的 binscatter 方法。该包包含七个命令:binsreg、binslogit、binsprobit、binsqreg、binstest、binspwc 和 binsregselect。前四个命令实现了经典和扩展最小二乘 binscatter 回归 (binsreg) 以及广义非线性 binscatter 回归(binslogit 用于 Logit 回归,binsprobit 用于 Probit 回归,binsqreg 用于分位数回归)的点估计和不确定性量化(置信区间和置信带)。这些命令还提供分箱散点图,支持单样本和多样本场景。接下来的两个命令专注于逐点推断和均匀推断:binstest 实现了对参数规范和非参数形状约束(未知回归函数)的假设检验程序,而 binspwc 实现了多组两两统计比较。这两个命令涵盖了最小二乘法和广义非线性 binscatter 方法。我们所有方法均支持多样本分析,这对于研究随机化研究和观察性研究中的处理效应异质性非常有用。最后,命令 binsregselect 使用分位数间隔或均匀间隔的分箱/划分,为 binscatter 方法实现了数据驱动的箱数选择器。所有命令均支持协变量调整、平滑约束、加权和聚类等多种功能。此外,还提供具有类似语法和功能的配套 Python 和 R 包。