Skip to main content

Implements binscatter methods, including partition selection, point estimation, pointwise and uniform inference methods, and graphical procedures.

Project description

BINSREG

Binscatter provides a flexible, yet parsimonious way of visualizing and summarizing large data sets and has been a popular methodology in applied microeconomics and other social sciences. The binsreg package provides tools for statistical analysis using the binscatter methods developed in Cattaneo, Crump, Farrell and Feng (2024a), Cattaneo, Crump, Farrell and Feng (2024b) and Cattaneo, Crump, Farrell and Feng (2024c). 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 conf idence 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.

Authors

Matias D. Cattaneo (cattaneo@princeton.edu)

Richard K. Crump (richard.crump@ny.frb.org)

Max H. Farrell (maxhfarrell@ucsb.edu)

Yingjie Feng (fengyingjiepku@gmail.com)

Ricardo Masini (rmasini@princeton.edu)

Website

https://nppackages.github.io/binsreg/

Major Upgrades

This package was first released in Winter 2019, and had one major upgrade in Summer 2021.

Summer 2021 new features include: (i) generalized linear models (logit, Probit, etc.) binscatter; (ii) quantile regression binscatter; (iii) new generic specification and shape restriction hypothesis testing function (now including Lp metrics); (iv) multi-group comparison of binscatter estimators; (v) generic point evaluation of covariate-adjusted binscatter; (vi) speed improvements and optimization. A complete list of upgrades can be found here.

Installation

To install/update use pip

pip install binsreg

Usage

from binsreg import binsregselect, binsreg, binsqreg, binsglm, binstest, binspwc

Dependencies

  • numpy
  • pandas
  • scipy
  • statsmodel
  • plotnine

References

For overviews and introductions, see NP Packages website.

Software and Implementation

  • Cattaneo, Crump, Farrell and Feng (2024c): Binscatter Regressions.
    Working paper, prepared for Stata Journal.

Technical and Methodological

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

binsreg-2.1.7.tar.gz (86.3 kB view details)

Uploaded Source

Built Distribution

binsreg-2.1.7-py3-none-any.whl (85.9 kB view details)

Uploaded Python 3

File details

Details for the file binsreg-2.1.7.tar.gz.

File metadata

  • Download URL: binsreg-2.1.7.tar.gz
  • Upload date:
  • Size: 86.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for binsreg-2.1.7.tar.gz
Algorithm Hash digest
SHA256 898bd6325320e5e88f95a5edc896ff81dd0f61203a68291982015a23e9a0a519
MD5 400dc8582900113a512695b5f4b19d3f
BLAKE2b-256 685e387e1243c2ca38aea1cd979c1e70e2afbd35da5ca7830bba2046e3bd67ed

See more details on using hashes here.

File details

Details for the file binsreg-2.1.7-py3-none-any.whl.

File metadata

  • Download URL: binsreg-2.1.7-py3-none-any.whl
  • Upload date:
  • Size: 85.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for binsreg-2.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2d66b8a7ec1431073a56f229c5fb3d8333d52fcc924f1fc48956555c93681a65
MD5 00fac69bfcbf0d204842b8392cf37e89
BLAKE2b-256 90e04f8ce711c3a4b85bb90ab7c85a61e7f39df3760b79405a36edb2bcddddf2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page