desc.stat: Descriptive statistics

Description Usage Arguments Value Examples

View source: R/99_DESC_STAT.R

Description

desc.stat returns the descriptive statistics of numeric risk factor. Reported metrics covers mainly univariate and part of bivariate analysis which are usually standard steps in credit rating model development. Metrics are reported for special (if exists) and complete case groups separately. Report includes:

Usage

1
desc.stat(x, y, sc = c(NA, NaN, Inf), sc.method = "together")

Arguments

x

Numeric risk factor.

y

Numeric target vector (binary or continuous).

sc

Numeric vector with special case elements. Default values are c(NA, NaN, Inf). Recommendation is to keep the default values always and add new ones if needed. Otherwise, if these values exist in x and are not defined in the sc vector, function will report the error.

sc.method

Define how special cases will be treated, all together or in separate bins. Possible values are "together", "separately".

Value

Data frame of descriptive statistics metrics, separately for complete and special case groups.

Examples

1
2
3
4
5
6
7
suppressMessages(library(monobinShiny))
data(gcd)
desc.stat(x = gcd$age, y = gcd$qual)
gcd$age[1:10] <- NA
gcd$age[50:75] <- Inf
desc.stat(x = gcd$age, y = gcd$qual, sc.method = "together")
desc.stat(x = gcd$age, y = gcd$qual, sc.method = "separately")

monobinShiny documentation built on Nov. 22, 2021, 9:07 a.m.