*! version 1.8 2022-03-24

Title

bunchtobit -- uses bunching, Tobit regressions, and covariates to point 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

bunchtobit
depvar [indepvars]
[if] [in]
[weight]
,
kink(#)
s0(#)
s1(#)
[
binwidth(#)
grid(numlist)
nopic
numiter(#)
savingtobit(filename[,replace])
verbose
]

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

Optional
indepvars is a varlist of covariates; heterogeneity is a linear function of these covariates and an unobserved error that is normally distributed
conditional on these covariates

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

binwidth(#) is the width of the bins for the histograms; it must be a strictly positive real number;
the default value is half of what is automatically produced by the command histogram

grid(numlist) is a numlist of integers from 1 to 99;
the values in the numlist correspond to percentages of the sample that define symmetric truncation windows around the kink point;
the truncated Tobit model is estimated on each of these samples
and also the full sample so that the number of estimates is always one more than the number of entries in numlist;
for example, if grid(15 82), then bunchtobit estimates the Tobit model three times using 100, 82, and 15 percent of the data around the kink point;
the default value for the numlist is 10(10)90, which provides 10 estimates

nopic suppresses displaying graphs; the default is to display graphs

numiter(#) is the maximum number of iterations allowed when maximizing the Tobit log likelihood;
it must be a positive integer and the default is 500

savingtobit(filename[,replace]) saves filename.dta with Tobit estimates for each truncation window;
the filename.dta file contains eight variables corresponding to the matrices that the code stores in r();
see below for more details;
use replace if filename.dta already exists in the working directory

verbose displays detailed output from the Tobit estimation including iterations of maximizing the log likelihood;
non-verbose mode is the default

Description

The user enters the name of the response variable, the location of the kink point, and the slopes before and after the kink point.
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.

bunchtobit estimates multiple mid-censored Tobit regressions using specified sub-samples of the data.
It starts with the entire sample, then it truncates the sample to symmetric windows centered at the kink as specified by the user.
The elasticity estimate is plotted as a function of the percentage of data used in each truncation window.
The code also plots the histogram of the response variable along with the best-fit Tobit distribution for each truncation window.

The user has the option of entering covariates that help explain the unobserved heterogeneity.
Lemma 1 by Bertanha, McCallum, and Seegert (2022) demonstrates that the distribution of the unobserved heterogeneity
conditional on covariates does not need to be normal for the Tobit estimates to be consistent.
Consistency requires (i) the unconditional distribution of heterogeneity is a semi-parametric mixture of normal distributions
averaged over the included covariates;
and (ii) the unconditional distribution of the response variable predicted by the Tobit model fits the observed distribution of the response variable well.
If the user does not enter covariates, then the unconditional distribution of heterogeneity needs to be normal.

(Go up to Syntax)

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 unobserved agent heterogeneity is a linear combination of three
binary covariates (x1, x2, and x3) plus a Gaussian error term.
The data also include randomly generated frequency weights "w".

Load the test data file included in the package:

. use bunching

Run a correctly specified bunchtobit with binwidth and savingtobit options:

. bunchtobit y x1 x2 x3 , k(2.0794) s0(0.2624) s1(-0.1054) binwidth(0.08) savingtobit(ctobitdata, replace)

Run a misspecified bunchtobit with verbose, numiter, binwidth, and savingtobit options:

. bunchtobit y x1 x3 , k(2.0794) s0(0.2624) s1(-0.1054) verbose numiter(1000) binwidth(0.08) savingtobit(mtobitdata, replace)

(Go up to Syntax)

Stored results

bunchtobit stores the following in r():

Matrices

r(tobit_theta_l_hat) intercept of the left-hand side equation

r(tobit_theta_r_hat) intercept of the right-hand side equation

r(tobit_sigma_hat) estimated standard deviation of the error term

r(tobit_perc_obs) percentage of observations selected by truncation window

r(tobit_eps_hat) elasticity estimate

r(tobit_se_hat) standard error of the elasticity estimator

r(tobit_covcol) number of covariates whose coefficients were restricted because of collinearity

r(tobit_flag) dummy that equals one if the log likelihood optimization did not converge

Scalars

r(binwidth) value of the bin width used in histograms

r(tobit_bin_n) number of bins used in histograms

(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.