BINSREG
The binsreg package provides tools for statistical analysis using the binscatter methods.
binsreg: implements binscatter least squares regression with robust inference and plots, including curve estimation, pointwise confidence intervals and uniform confidence band.binsqreg: implements binscatter quantile regression with robust inference and plots, including curve estimation, pointwise confidence intervals and uniform confidence band.binsglm: implements binscatter generalized linear regression with robust inference and plots, including curve estimation, pointwise confidence intervals and uniform confidence band.binstest: implements binscatter-based hypothesis testing procedures for parametric specifications of and shape restrictions on the unknown function of interest.binspwc: implements hypothesis testing procedures for pairwise group comparison of binscatter estimators.binsregselect: implements data-driven number of bins selectors for binscatter implementation using either quantile-spaced or evenly-spaced binning/partitioning.
All the commands allow for covariate adjustment, smoothness restrictions, and clustering, among other features. See Cattaneo, Crump, Farrell and Feng (2024, 2025, 2026) for references.
Website: https://nppackages.github.io/.
Source code: https://github.com/nppackages/binsreg.
Authors
Matias D. Cattaneo (matias.d.cattaneo@gmail.com)
Richard K. Crump (richard.crump@gmail.com)
Max H. Farrell (mhfarrell@gmail.com)
Yingjie Feng (fengyingjiepku@gmail.com)
Ricardo Masini (ricardo.masini@gmail.com)
Installation
To install/update use pip
pip install binsreg
Usage
from binsreg import binsregselect, binsreg, binsqreg, binsglm, binstest, binspwc
- Replication: binsreg illustration, plot illustration, simulated data.
Dependencies
- numpy
- pandas
- scipy
- statsmodels
- plotnine
References
For overviews and introductions, see NP Packages website.
Software and Implementation
- Cattaneo, Crump, Farrell and Feng (2025): Binscatter Regressions.
Stata Journal 25(1): 3-50.
Technical and Methodological
-
Cattaneo, Crump, Farrell and Feng (2024): On Binscatter.
American Economic Review 114(5): 1488-1514.
Supplemental Appendix -
Cattaneo, Crump, Farrell and Feng (2026): Nonlinear Binscatter Methods.
Review of Economics and Statistics, revise and resubmit.
Supplemental Appendix
Release files for binsreg 3.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| binsreg-3.2.1.tar.gz | 92.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| binsreg-3.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 184.7 kB
Release files / binsreg-3.2.1.tar.gz
| Download URL | binsreg-3.2.1.tar.gz |
|---|---|
| Size | 92.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b8d0b1cddfdfd042e4eca837058d98ec55e9781b32fb42b437dd08c933647c2
|
|
BLAKE2b-256 checksum How to use checksums |
acfc62948125665358cff87907227ddeaa18ea3416de5437d337003656f4ac9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / binsreg-3.2.1-py3-none-any.whl
| Download URL | binsreg-3.2.1-py3-none-any.whl |
|---|---|
| Size | 92.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f006d36987fcad721c1577c3565e5eab9d9fffc6ea8b6c9a4020d2178fcaf20a
|
|
BLAKE2b-256 checksum How to use checksums |
60539160603d9a0ec3d423428249b4cacf717c0f14b9ed4720bd190c30451375
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency log