hhi {PDtoolkit}R Documentation

Herfindahl-Hirschman Index (HHI)

Description

hhi performs calculation on Herfindahl-Hirschman Index.

Usage

hhi(x)

Arguments

x

Numeric vector of input values (e.g. number of observations or sum of exposure per rating grade).

Value

The command hhinormal.test returns single element numeric vector of HHI value.

Examples

#simulate PD model and rating scale
suppressMessages(library(PDtoolkit))
data(loans)
res <- stepFWDr(start.model = Creditability ~ 1, 
   p.value = 0.05, 
   db = loans)
mod.predictions <- unname(predict(res$model, type = "response"))
rating.scale <- sts.bin(y = loans$Creditability, x = mod.predictions)[[1]]
#calculate HHI 
hhi(x = rating.scale$no)

[Package PDtoolkit version 1.2.0 Index]