Credit Risk can be defined as the risk of bankruptcy/financial distress where debtors cannot pay what they owe. This risk is constant and unrelenting and companies should endeavour to ascribe accurate measures of potential default including in circumstances where credit is advanced in the form of goods being sold without receiving immediate payment. Credit risk measurement is important for companies making decisions regarding where, when and who to lend to and to determine what risks are being undertaken? Credit risk is also important for financial institutions where liquidity is generally supplied to keep trade flowing. Altman Z scores were an early form of systematised calibration of risk factors. Altman (1968) developed one of the earlier forms of the following scoring system and today many companies focus on how
In following series of videos I follow Loeffler and Posch's text where tune the appropriate weights for Altman Z above using OLS and Logit regression. See R code below.
# Code from Probit and Logit Models in R
# using Loeffler and Posch
#mydata<- read.csv("CreditRiskf.csv")
attach(mydata)
# Define variables
Y <- cbind(Default)
X <- cbind(WC.TA, RE.TA, EBIT.TA, ME.TL, S.TA)
# Descriptive statistics
summary(Y)
summary(X)
table(Y)
table(Y)/sum(table(Y))
# Regression coefficients
olsreg <- lm(Y ~ X)
summary(olsreg)
# Logit model coefficients
logit<- glm(Y ~ X, family=binomial (link = "logit"))
summary(logit)
# Logit model odds ratios
exp(logit$coefficients)
# Probit model coefficients
probit<- glm(Y ~ X, family=binomial (link="probit"))
summary(probit)
# Regression marginal effects
coef(olsreg)
# Logit model average marginal effects
LogitScalar <- mean(dlogis(predict(logit, type = "link")))
LogitScalar * coef(logit)
# Probit model average marginal effects
ProbitScalar <- mean(dnorm(predict(probit, type = "link")))
ProbitScalar * coef(probit)
# Regression predicted probabilities
polsreg<- predict(olsreg)
summary(polsreg)
# Logit model predicted probabilities
plogit<- predict(logit, type="response")
summary(plogit)
# Probit model predicted probabilities
pprobit<- predict(probit, type="response")
summary(pprobit)
# Percent correctly predicted values
table(true = Y, pred = round(fitted(probit)))
table(true = Y, pred = round(fitted(logit)))
# McFadden's Pseudo R-squared
probit0<-update(probit, formula= Y ~ 1)
McFadden<- 1-as.vector(logLik(probit)/logLik(probit0))
McFadden