Bin continuous data using the equal frequency binning method.

rbin_equal_freq(data = NULL, response = NULL, predictor = NULL, bins = 10)

# S3 method for rbin_equal_freq
plot(x, print_plot = TRUE, ...)

Arguments

data

A data.frame or tibble.

response

Response variable.

predictor

Predictor variable.

bins

Number of bins.

x

An object of class rbin_quantiles.

print_plot

logical; if TRUE, prints the plot else returns a plot object.

...

further arguments passed to or from other methods.

Value

A tibble.

Examples

bins <- rbin_equal_freq(mbank, y, age, 10) bins
#> Binning Summary #> ------------------------------------ #> Method Equal Frequency #> Response y #> Predictor age #> Bins 10 #> Count 4521 #> Goods 517 #> Bads 4004 #> Entropy 0.51 #> Information Value 0.01 #> #> #> lower_cut upper_cut bin_count good bad good_rate #> 1 18 29 452 55 397 0.12168142 #> 2 29 31 452 57 395 0.12610619 #> 3 31 34 452 46 406 0.10176991 #> 4 34 36 452 44 408 0.09734513 #> 5 36 39 452 58 394 0.12831858 #> 6 39 42 452 51 401 0.11283186 #> 7 42 46 452 45 407 0.09955752 #> 8 46 51 452 60 392 0.13274336 #> 9 51 56 452 53 399 0.11725664 #> 10 56 84 453 48 405 0.10596026 #> woe iv entropy #> 1 -0.07040317 5.091649e-04 0.5341748 #> 2 -0.11117177 1.289604e-03 0.5466619 #> 3 0.13070550 1.623852e-03 0.4745811 #> 4 0.18007127 3.023706e-03 0.4605229 #> 5 -0.13109837 1.807071e-03 0.5528088 #> 6 0.01512953 2.275202e-05 0.5083990 #> 7 0.15514443 2.266308e-03 0.4675914 #> 8 -0.17008899 3.087466e-03 0.5649142 #> 9 -0.02833676 8.116094e-05 0.5214234 #> 10 0.08567979 7.116156e-04 0.4876093
# plot plot(bins)