rbin_winsorize {rbin} | R Documentation |
Winsorized binning
Description
Bin continuous data using winsorized method.
Usage
rbin_winsorize(
data = NULL,
response = NULL,
predictor = NULL,
bins = 10,
include_na = TRUE,
winsor_rate = 0.05,
min_val = NULL,
max_val = NULL,
type = 7,
remove_na = TRUE
)
## S3 method for class 'rbin_winsorize'
plot(x, print_plot = TRUE, ...)
Arguments
data |
A |
response |
Response variable. |
predictor |
Predictor variable. |
bins |
Number of bins. |
include_na |
logical; if |
winsor_rate |
A value from 0.0 to 0.5. |
min_val |
the low border, all values being lower than this will be replaced by this value. The default is set to the 5 percent quantile of predictor. |
max_val |
the high border, all values being larger than this will be replaced by this value. The default is set to the 95 percent quantile of predictor. |
type |
an integer between 1 and 9 selecting one of the nine quantile algorithms detailed in |
remove_na |
logical; if |
x |
An object of class |
print_plot |
logical; if |
... |
further arguments passed to or from other methods. |
Value
A tibble
.
Examples
bins <- rbin_winsorize(mbank, y, age, 10, winsor_rate = 0.05)
bins
# plot
plot(bins)