Analyze Bunching in a Kink or Notch Setting

View and analyze data where bunching is expected. Estimate counter- factual distributions. For earnings data, estimate the compensated elasticity of earnings w.r.t. the net-of-tax rate.

bunchr: Analyze bunching in a kink or notch setting

Itai Trilnick 2016-06-14

The bunchr package is meant to help analyze bunching in a labor economics setting. bunchr allows easy viewing of bunching histograms, creation of counter-factual distributions, and estimation of the elasticity of earnings w.r.t. the net-of-tax rate in kink and notch settings. At the time of writing these lines, I am unaware of any other R package doing so. I hope to keep improving this package so it is useful to many researchers.

To validate the kink analysis, results from bunchr are compared with an existing Stata utility function that was used in a peer reviewed article by Chetty, Friedman, Olsen, and Pistaferry (see vignette). I am happy to to get comments and references to other codes for bunching analysis.

Below are a few words about bunching analysis, kinks, and notches. For more information, references, and examples, please see the package vignettes.

In many cases, tax and welfare programs have points where incentives change in such way that people are expected to bunch at one side of point. For example, people are expected to bunch at the point where income tax rates increase, creating a kink in agents' budget lines. In another case, beneficiaries of Social Security Disability Insurance in the US are not allowed to work and earn above a certain dollar amount, and those who cross that threshold risk losing their benefits. This creates a notch in beneficiaries' budget lines, and bunching is expected (and seen) at that earning level.

Kinks and notches create opportunities to measure the earning elasticity w.r.t the net-of-tax rate. This parameter is considered sufficient statistic for calculating welfare from changes in tax regimes and welfare programs, and could also be used to devise optimal tax rates.


bunchr 1.2.0

January 29st, 2017

  • bunchApp feature added: controll level of noise.

bunchr 1.1.1

December 1st, 2016

  • A little bug fixed

bunchr 1.1.0

December 1st, 2016

  • Added bunchApp! This Shiny powered app lets you play with bunching simulation on an interactive interface. Play with it to understand the strengths and weaknesses of bunching estimation. The package now imports shiny.

bunchr 1.0.1

November 8th, 2016

  • Corrected an error in Vignette

bunchr 1.0.0

August 8th, 2016

  • Added option to force notch size for notch analysis
  • Users can now set title and x-axis label for plots.
  • Replaced clumsy bootstrap counter by optional text-based progress bar
  • Corrected some typos in documentation

bunchr 0.1

June 16th, 2016

  • first release! check out readme file and vignettes.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.2.0 by Itai Trilnick, 5 years ago

Report a bug at

Browse source code at

Authors: Itai Trilnick [aut, cre]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports stats, graphics, utils, shiny

Suggests knitr, rmarkdown, testthat, roxygen2

See at CRAN