Description Usage Arguments Details Note
The bin function automates the binning process of all types of variables. It can create automated bins, quantile defined bins, factor defined bins and customised bins (using customised cut-off points). The function bins does the same thing as bin only without printing and plotting any outputs.
1 |
x |
The desired continuous or categorical variable that needs to be binned. Name of variable must be given in quotes; "variable". |
y |
Binary response variable (0,1). Integer (int) is required. Name of y must not have a dot. Name of variable must be given in quotes; "variable". |
data |
The data frame containing the x and y variables. |
type |
The type of binning that will be taking place, which is also linked to what type of variable x is. The available options are:
|
q |
If type = "q": The size of the quantiles used for binning. Default value is 0.2, which means that there will be 5 bins, each containing 20% of the data. |
cut |
If type = "c": A vector containing cut-off points that allows the creation of customised bins. Values chosen must be from the x variable. Default value is NULL, if unchanged, output will be automatic as if 'type = "a"'. |
The type is the most important argument; when it equals to "a" or "f", the arguments q and cut will become redundant. The arguments q and cut will only be taken into account when the values for type are "q" and c respectively.
Note that if type = "c" and no vector was entered for the cut argument, the function will perform automatic binning.
If type = "c" and no vector was entered for the cut argument, the function will perform automatic binning.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.