*! version 1.7 2022-03-24

Title

bunchbounds -- uses bunching to partially identify the elasticity of a response variable
with respect to changes in the slope of the budget set
according to the procedures of Bertanha, McCallum, and Seegert (2022).

Syntax

bunchbounds
depvar
[if] [in]
[weight]
,
kink(#)
s0(#)
s1(#)
m(#)
[ nopic
savingbounds(filename[,replace])
]

Required
depvar must be one dependent variable (the response variable in logs in many applications)

kink(#) is the location of the kink point and must be a real number in the same units as the response variable

s0(#) is a real number; in many applications, it is the log of the slope before the kink point

s1(#) must be a real number that is strictly less than s0; in many applications, it is the log of the slope after the kink point

m(#) is the maximum slope magnitude of the probability density function (PDF) of the unobserved heterogeneity, a strictly positive scalar

Optional
if | in like in any other Stata command, to restrict the working sample

weight follows Stata's weight syntax and only allows frequency weights, fweight

nopic suppresses displaying graphs; the default is to display graphs

savingbounds(filename[,replace]) saves filename.dta with coordinates of the partially-identified set as a function
of the slope magnitude of the heterogeneity PDF; use replace if filename.dta already exists in the working directory

Description

The user enters the name of the response variable, the location of the kink point, the slopes before and after the kink point,
and the maximum slope magnitude of the heterogeneity PDF.
For example, in the income-tax application of Bertanha, McCallum, and Seegert (2022), dollars of taxable income and the dollar value of the kink point
are transformed by taking logs, and the slopes must be input as the log of one minus the marginal tax rates.
You need to have a dataset with the response variable drawn from a mixed continuous-discrete distribution. The distribution is continuous except for the
kink value, which has a positive mass point.
The proportion of values at the kink value must be positive in your sample.
Check to see if count if y==kink (where y is the response variable) gives you the right number. In case it gives you zero when it should not, check the
value of the kink and if y is type double.

bunchbounds computes the maximum and minimum values of the elasticity that are consistent with the slope restriction on the PDF specified in m,
the observed distribution of the response variable, and values of the PDF of the response variable evaluated at the left and right limits approaching the kink.
These limits are computed non-parametrically using the method of Cattaneo, Jansson and Ma (2020) as implemented by their Stata package lpdensity,
discussed by Cattaneo, Jansson and Ma (2021).
Thus, the user needs to install lpdensity before using bunchbounds.

It is important to emphasize that the true value of the slope magnitude is unknowable but bunchbounds provides four sample values as suggestions for the user.
The first two sample values are estimated using the continuous part of the distribution.
Specifically, minimum and maximum slope magnitude sample values are constructed from a histogram of the dependent variable that excludes the kink point
and uses a bin width that is half of the default bin width for the command histogram.
The third sample value is the maximum slope magnitude that results in a finite upper bound on the elasticity.
The fourth sample value is the minimum slope magnitude for which the elasticity bounds exist and are equal.
This is the same elasticity estimate that one obtains with the trapezoidal approximation.
bunchbounds outputs elasticity bounds for three values of the slope: trapezoidal approximation, user-provided slope magnitude m,
and the maximum slope magnitude that results in a finite upper bound.

Example

The package includes the sample data file "bunching.dta". The income data in logs (i.e., "y")
were simulated using a middle-censored model with an elasticity of 0.5.
The budget constraint has a kink at ln(8) with log slopes of ln(1.3) and ln(0.9), respectively, to the left and right of the kink.
These correspond to tax rates to the left and right of the kink of -30 and 10 percent,
respectively.
The data also include randomly generated frequency weights "w".

Load the test data file included in the package:

. use bunching

Run bunchbounds with frequency weights and save graph points in a dta file:

. bunchbounds y [fweight=w], k(2.0794) s0(0.2624) s1(-0.1054) m(2) savingbounds(dbounds.dta, replace)

(Go up to Syntax)

Stored results

bunchbounds stores the following in r():

Scalars

r(bounds_e_trap) estimated elasticity using trapezoidal approximation

r(bounds_emin_mmax) lower bound estimate for the elasticity using constant m entered by user

r(bounds_emax_mmax) upper bound estimate for the elasticity using constant m entered by user

r(bounds_M_hat) if the heterogeneity PDF has a maximum slope magnitude greater than M_hat, then we
cannot rule out PDFs that equal zero inside the bunching interval;
in this case, the upper bound is infinity

r(bounds_M_min_hat) if the heterogeneity PDF has a maximum slope magnitude smaller than M_min_hat,
then no heterogeneity PDF is consistent with the observed distribution of income;
bounds are not defined

r(bounds_M_data_min) minimum value of the slope magnitude in the estimated PDF of the observed distribution of income (continuous part of the PDF)

r(bounds_M_data_max) maximum value of the slope magnitude in the estimated PDF of the observed distribution of income (continuous part of the PDF)

r(bounds_emin_mhat) lower bound estimate for the elasticity if the choice of m were equal to M_hat;
available only when the choice of m entered by user is bigger than M_hat

r(bounds_emax_mhat) upper bound estimate for the elasticity if the choice of m were equal to M_hat;
available only when the choice of m entered by user is bigger than M_hat

(Go up to Syntax)

Authors

Marinho Bertanha, mbertanha@nd.edu, University of Notre Dame

Andrew McCallum, andrew.h.mccallum@frb.gov, Federal Reserve Board

Nathan Seegert, nathan.seegert@eccles.utah.edu, University of Utah.

Reference

Bertanha, M., McCallum, A., Seegert, N. (2022), "Better Bunching, Nicer Notching". Working paper SSRN 3144539.

Bertanha, M., McCallum, A., Payne, A., Seegert, N. (2022), "Bunching Estimation of Elasticities Using Stata".
Stata Journal, forthcoming.

Cattaneo, M., Jansson, M., Ma, X. (2020), "Simple Local Polynomial Density Estimators".
Journal of the American Statistical Association 115(531), pg 1449 - 1455.

Cattaneo, M., Jansson, M., Ma, X. (2022), "lpdensity: Local Polynomial Density Estimation and Inference".
Journal of Statistical Software 101(2): 1-25, January 2022.
https://nppackages.github.io/lpdensity/