smbinning.factor: Binning on Factor Variables

Description Usage Arguments Value Examples

View source: R/smbinning.R

Description

It generates a table with relevant metrics for all the categories of a given factor variable.

Usage

1
smbinning.factor(df, y, x, maxcat = 10)

Arguments

df

A data frame.

y

Binary response variable (0,1). Integer (int) is required. Name of y must not have a dot.

x

A factor variable with at least 2 different values. Labesl with commas are not allowed.

maxcat

Specifies the maximum number of categories. Default value is 10. Name of x must not have a dot.

Value

The command smbinning.factor generates and object containing the necessary info and utilities for binning. The user should save the output result so it can be used with smbinning.plot, smbinning.sql, and smbinning.gen.factor.

Examples

1
2
3
4
5
6
# Load library and its dataset
library(smbinning) # Load package and its data

# Binning a factor variable
result=smbinning.factor(chileancredit,x="inc",y="fgood", maxcat=11)
result$ivtable

smbinning documentation built on Dec. 1, 2017, 9:02 a.m.