Description Usage Arguments Details Value References See Also Examples

Given a kinked budget set, this function gets a vector of earnings and
analyzes bunching. This function could be run independently, but best used
through the `bunch`

function.

1 2 3 4 |

`earnings` |
Vector of earnings, hopefully a very large one. |

`zstar` |
Place of kink (critical earning point). |

`t1` |
Marginal tax rate before kink. |

`t2` |
Marginal tax rate after kink. |

`cf_start` |
Number of bins before the kink bin where counter-factual histogram should start. |

`cf_end` |
Number of bins after the kink bin where counter-factual histogram should start. |

`exclude_before` |
Number of excluded bins before the kink bin. |

`exclude_after` |
Number of excluded bins after the kink bin. |

`binw` |
Bin width. |

`poly_size` |
Order of polynomial used to calculate counter-factual histogram. |

`convergence` |
Minimal rate of change of bunching estimate to stop iterations. |

`max_iter` |
Maximum number of iterations for bunching estimates. |

`correct` |
Should the counter-factual histogram be corrected to compensate for shifting left because of the notch? See details. |

`select` |
Should model selection be used to find counter-factual histogram? See details. |

`draw` |
Should a graph be drawn? |

`title` |
Title for plot output |

`varname` |
Name for running variable, to be desplayed in the plot |

A histogram is created from the earnings vector, with the kink point zstar as the center of one of the bins.

Correction of the counter-factual is required, as the kink-induced bunching
will shift the whole distribution on the right side of the kink to the left.
This option follows Chetty *et al* (2009) in correcting for this.

Model selection works using the `step`

function from the stats package.
It runs backwards from the full polynomial model, trying to find the best
explanatory model using the Akaike information criterion.

`kink_estimator`

returns a list of the following variables:

`e`

Estimated elasticity

`Bn`

The sum of total estimated extra bunching in the excluded bins

`b`

The rate of extra bunching in the excluded area, divided by the length of area in \$

`data`

A data frame with bin mids, counts, counter-factual counts, and excluded dummy

Chetty, R., Friedman, J., Olsen, T., Pistaferri, L. (2009)
*Adjustment Costs, Firm Responses, and Micro vs. Macro Labor Supply
Elasticities: Evidence from Danish Tax Records*, Quarterly Journal of
Economics, 126(2).

1 2 3 4 | ```
ability_vec <- 4000 * rbeta(100000, 2, 5)
earning_vec <- sapply(ability_vec, earning_fun, 0.2, 0, 0.2, 0, 1000)
# bunch_viewer(earning_vec, 1000, 40, 40, 1, 1, binw = 10)
kink_estimator(earning_vec, 1000, 0, 0.2, 40, 40, 1, 1, binw = 10, draw = FALSE)$e
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.