powered by
Create data frame of binned counts
bin_data(z_vector, binv = "median", zstar, binwidth, bins_l, bins_r)
bin_data returns a data frame with bins and corresponding frequencies (counts).
bin_data
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.
bunchit
data(bunching_data) binned_data <- bin_data(z_vector = bunching_data$kink, zstar = 10000, binwidth = 50, bins_l = 20, bins_r = 20) head(binned_data)
Run the code above in your browser using DataLab