powered by
Bin continuous data using winsorized method.
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 rbin_winsorize plot(x, print_plot = TRUE, ...)
# S3 method for rbin_winsorize plot(x, print_plot = TRUE, ...)
A data.frame or tibble.
data.frame
tibble
Response variable.
Predictor variable.
Number of bins.
logical; if TRUE, a separate bin is created for missing values.
TRUE
A value from 0.0 to 0.5.
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.
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.
an integer between 1 and 9 selecting one of the nine quantile algorithms detailed in quantile() to be used.
quantile()
logical; if TRUE NAs will removed while calculating quantiles
An object of class rbin_winsorize.
rbin_winsorize
logical; if TRUE, prints the plot else returns a plot object.
further arguments passed to or from other methods.
A tibble.
# NOT RUN { bins <- rbin_winsorize(mbank, y, age, 10, winsor_rate = 0.05) bins # plot plot(bins) # }
Run the code above in your browser using DataLab