Learn R Programming

bunching (version 0.8.4)

bin_data: Bin the raw data

Description

Create data frame of binned counts

Usage

bin_data(z_vector, binv = "median", zstar, binwidth, bins_l, bins_r)

Value

bin_data returns a data frame with bins and corresponding frequencies (counts).

Arguments

z_vector

a numeric vector of (unbinned) data.

binv

a string setting location of zstar within its bin ("min", "max" or "median" value). Default is median.

zstar

a numeric value for the the bunching point.

binwidth

a numeric value for the width of each bin.

bins_l

number of bins to left of zstar to use in analysis.

bins_r

number of bins to right of zstar to use in analysis.

See Also

bunchit

Examples

Run this code
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