Bin continuous data using the equal frequency binning method.

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

Arguments

data

A data.frame or tibble.

response

Response variable.

predictor

Predictor variable.

bins

Number of bins.

Value

A tibble.

Examples

rbin_equal_freq(mbank, y, age, 10)
#> # A tibble: 20 x 9 #> lower_cut upper_cut bin_count good bad good_rate woe iv entropy #> <int> <int> <int> <int> <int> <dbl> <dbl> <dbl> <dbl> #> 1 18 27 226 48 178 0.212 -0.736 3.56e-2 0.746 #> 2 27 29 226 29 197 0.128 -0.131 9.04e-4 0.553 #> 3 29 30 226 28 198 0.124 -0.0909 4.28e-4 0.540 #> 4 30 31 226 25 201 0.111 0.0374 6.90e-5 0.502 #> 5 31 33 226 26 200 0.115 -0.00679 2.31e-6 0.515 #> 6 33 34 226 18 208 0.0796 0.400 6.86e-3 0.401 #> 7 34 35 226 25 201 0.111 0.0374 6.90e-5 0.502 #> 8 35 36 226 20 206 0.0885 0.285 3.64e-3 0.431 #> 9 36 37 226 26 200 0.115 -0.00679 2.31e-6 0.515 #> 10 37 39 226 21 205 0.0929 0.231 2.45e-3 0.446 #> 11 39 40 226 9 217 0.0398 1.14 4.18e-2 0.241 #> 12 40 42 226 28 198 0.124 -0.0909 4.28e-4 0.540 #> 13 42 44 226 19 207 0.0841 0.341 5.10e-3 0.416 #> 14 44 46 226 24 202 0.106 0.0832 3.35e-4 0.488 #> 15 46 48 226 15 211 0.0664 0.597 1.41e-2 0.352 #> 16 48 51 226 19 207 0.0841 0.341 5.10e-3 0.416 #> 17 51 53 226 25 201 0.111 0.0374 6.90e-5 0.502 #> 18 53 56 226 25 201 0.111 0.0374 6.90e-5 0.502 #> 19 56 58 226 21 205 0.0929 0.231 2.45e-3 0.446 #> 20 59 84 227 66 161 0.291 -1.16 1.01e-1 0.870