Create a binned plot for quick exploration without estimating bunching mass.
plot_hist(
z_vector,
binv = "median",
zstar,
binwidth,
bins_l,
bins_r,
p_title = "",
p_xtitle = "z_name",
p_ytitle = "Count",
p_title_size = 11,
p_axis_title_size = 10,
p_axis_val_size = 8.5,
p_miny = 0,
p_maxy = NA,
p_ybreaks = NA,
p_grid_major_y_color = "lightgrey",
p_freq_color = "black",
p_zstar_color = "red",
p_freq_size = 0.5,
p_freq_msize = 1,
p_zstar_size = 0.5,
p_zstar = TRUE
)
plot_hist
returns a list with the following:
the plot of the density without estimating a counterfactual.
the binned data used for the plot.
a numeric vector of (unbinned) data.
a string setting location of zstar within its bin ("min", "max" or "median" value). Default is median.
a numeric value for the the bunching point.
a numeric value for the width of each bin.
number of bins to left of zstar to use in analysis.
number of bins to right of zstar to use in analysis.
plot's title. Default is empty.
plot's x_axis label. Default is the name of z_vector.
plot's y_axis label. Default is "Count".
size of plot's title. Default is 11.
size of plot's axes' title labels. Default is 10.
size of plot's axes' numeric labels. Default is 8.5.
plot's minimum y_axis value. Default is 0.
plot's maximum y_axis value. Default is optimized internally.
a numeric vector of y-axis values at which to add horizontal line markers in plot. Default is optimized internally.
plot's y-axis major grid line color. Default is "lightgrey".
plot's frequency line color. Default is "black".
plot's bunching region marker lines color. Default is "red".
plot's frequency line thickness. Default is 0.5.
plot's frequency line marker size. Default is 1.
plot's bunching region marker line thickness. Default is 0.5.
whether to show vertical line for zstar. Default is TRUE.
bunchit
# visualize a distribution
data(bunching_data)
plot_hist(z_vector = bunching_data$kink_vector,
binv = "median", zstar = 10000,
binwidth = 50, bins_l = 40, bins_r = 40)$plot
Run the code above in your browser using DataLab