levelsCollapser {CollapseLevels} | R Documentation |
levelsCollapser
Description
This function displays the response rates by the levels of an attribute Levels with similar response rates may be combined
Usage
levelsCollapser(dset, resp = "y", bins = 10)
Arguments
dset |
The data frame containing the data set |
resp |
A character respresenting the name of the binary outcome variable The binary outcome variable may be a factor with two levels or an integer (or numeric ) with two unique values |
bins |
A number denoting the number of bins.Default value is 10 |
Value
A list containing the tables of response rate by levels for every attribute
Examples
# Load the German_Credit data set supplied with this package
data("German_Credit")
# Create an empty list
l<-list()
# Call the function as follows
l<-levelsCollapser(German_Credit,resp="Good_Bad",bins=10)
# response rate by levels of the Account_Balance in the German_Credit data
l$Account_Balance
# Collapse levels with similar response percentages.
[Package CollapseLevels version 0.3.0 Index]