Description Usage Arguments Value See Also Examples
This function is meant to aid find excluded bins and analysis area for a bunching study. It displays a histogram with borders. Optionally, you can get the actual histogram back. This is convenient, as the kink/notch point is set as the center of a bin.
1 2 3 |
earnings |
Vector of earnings, hopefully a very large one |
zstar |
Place of notch/kink (critical earning point) |
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. |
trimy |
Logical. Should the y-axis be trimmed to better show off-bunching histogram? |
report |
Should the function return the actual histogram? |
title |
Title for Plot output |
varname |
Name for running variable, to be desplayed in the plot |
A plot, the actual histogram if report is set to TRUE.
1 2 3 | ability_vec <- 4000 * rbeta(100000, 2, 5)
earning_vec <- sapply(ability_vec, earning_fun, 0.2, 0.1, 0.2, 0, 1000)
bunch_viewer(earning_vec, 1000, 20, 40, 2, 2, 20, trimy = TRUE, report = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.