Skip to main content
Table of Contents
< All Topics
Print

Step 8 – Correlation between variable couples

Purpose

This implementation follows step by step the content of Chap. 4, section 4.5.7 : Correlations, pp. 160-162

Method

Testing on selected ratio variables (page 161) – -> (https://github.com/MoiraCorp/DLMM-IRating-in-R/tree/main/steps/step8/selectvar)

Correlation study for all ratio variables (page 162) – -> (https://github.com/MoiraCorp/DLMM-IRating-in-R/tree/main/steps/step8/allvar)

Using another correlation display from R – -> (https://github.com/MoiraCorp/DLMM-IRating-in-R/tree/main/steps/step8/alternr)

Testing on selected ratio variables (page 161)

 

In order to illustrate the process (Table 4.19, pp 161), the authors have selected the following ratio variables:

  • ROE-86 = Ratio Net Profit/Equity

  • IEONLIAB-101 = Interest Expenses/Liabilities

  • V110A-107 = Inventories/Total Assets

    Using the cor() function from the standard R package:

corrprs<- cor(wcs2train[,c(86,101,107)], use=”pairwise”, method=”pearson”) corrprs

The printed output is:
 
ROEIEONLIABV110A
ROE1.00000000-0.02538354-0.03441025
IEONLIAB-0.025383541.00000000-0.03018398
V110A-0.03441025-0.030183981.00000000

In order to compute the matrix of p-value, the custom cor.pvalue() R function is used following: -> http://www.sthda.com/english/wiki/visualize-correlation-matrix-using-correlogram

cor.pvalue <- function(mat, …) { mat <- as.matrix(mat) n <- ncol(mat) p.mat<- matrix(NA, n, n) diag(p.mat) <- 0 for (i in 1:(n – 1)) { for (j in (i + 1):n) { tmp <- cor.test(mat[, i], mat[, j], …) p.mat[i, j] <- p.mat[j, i] <- tmp$p.value } } colnames(p.mat) <- rownames(p.mat) <- colnames(mat) p.mat }

# matrix of the p-value of the correlation p.mat<- cor.pvalue (wcs2train[,c(86,101,107)]) p.mat

The printed output is:
 
ROEIEONLIABV110A
ROE0.00000000.36569720.2200474
IEONLIAB0.36569720.00000000.2820608
V110A0.22004740.28206080.0000000
NOTE : The values of correlation and p-value are combined in one table on page 161

corrspm<- cor(wcs2train[,c(86,101,107)], use=”pairwise”, method=”spearman”) corrspm

The printed output is:
 
ROEIEONLIABV110A
ROE1.00000000-0.15264427-0.05102912
IEONLIAB-0.152644271.000000000.02129009
V110A-0.051029120.021290091.00000000

In supplement, the R cor() function offers the Kendall parametric correlation

corrken<- cor(wcs2train[,c(86,101,107)], use=”pairwise”, method=”kendall”) corrken

The printed output is:
 
ROEIEONLIABV110A
ROE1.0000000-0.10461972-0.03484200
IEONLIAB-0.10461971.000000000.01552111
V110A-0.03484200.015521111.00000000

Correlation study for all ratio variables (page 162)

 

The ratio variables span indexes 86 to 119 in the 7a) Testing on selected ratio variables (page 161) data table
We are using the corrplot R package for display.<br We are following the examples of: -> http://www.sthda.com/english/wiki/visualize-correlation-matrix-using-correlogram

install.packages(“corrplot”)
library(corrplot)
corrprs <- cor(wcs2train[,c(86:119)], use=”pairwise”, method=”pearson”)
p.mat <- cor.pvalue(wcs2train[,c(86:119)])
col <- colorRampPalette(c(“#BB4444”, “#fcc3b8”, “#FFFFFF”, “#add2f7”, “#4fc69d”))
corrplot(corrprs, method=”color”, col=col(200),
type=”upper”,
addCoef.col = “black”, # Add coefficient of correlation
addCoefasPercent = TRUE,
tl.col=”black”, tl.srt=45, # Text label color and rotation
# Combine with significance p.mat = p.mat, sig.level = 0.01, insig = “blank”,
# hide correlation coefficient on the principal diagonal
diag=FALSE
)

NOTE: Hexa ramp colors have been tuned using tool in Google Search. The display blanks out the color of cells below significance level of 0.01 (1%), as indicated on page 160, last line.

The graphics representation of the Pearson correlation between all Ratio Variables is presented in: Table_4_19b_Page 162_Ratios_Correlation.pdf

From this diagram, we detremine the following groups of correlated variables (over 70%).
NOTE: The groups are identical to those proposed in the author’s text

GR1: ROE, ROETR (Negative 73% with ROE), DEBTEQUTR (Negative 69% with ROETR and 51% with ROE)

Column in R tableCode in textDescription
ROE-86ROERatio Net Profit/Equity
DEBTEQUTR-118DebtEquityTrRatio Interest-bearing Financial Debt/Equity
ROETR-119ROETrRatio Net Profit/Total Stockholder’s Equity

GR2: EBITDAON, V89A (88% with EBITDAON), ROS (99% with EBITDAON)

Column in R tableCode in textDescription
EBITDAON-87EBITDAonSALESRatio EBITDA/Sales [%]
V89A-90EBITDAonVPRatio EBITDA/Value of Production
ROS-91ROSRatio EBIT/Sales [%]

GR3: ROI, ASSETSTU (99% with ROI and ROA), ROA (100% with ROI), IEONLIAB (73% with ROAMINUS), ROAMINUS (100% with ROI and ROA and 99% with ASSETSTU)

Column in R tableCode in textDescription
ROI-88ROIRatio EBIT/Operating Assets [%]
ASSETSTU-92ASSETS_TURNOVERRatio Total Assets/Turnover
ROA-89ROARatio Current Income/Total Assets [%]
IEONLIAB-101IEonLIABLITIESRatio Interest Expenses/Liabilities [%]
ROAMINUS-115ROAminusIEonTLROA minus Ratio Interest Expenses/Total Liabilities

GR4: V94A, V95A, COMMERCI (98% with V95A)

Column in R tableCode in textDescription
V94A-95RECEIVABLES_PERIODRatio Trade Receivables/Daily Sales
V95A-96INVENTORY_PERIODRatio Inventory/Daily Sales
COMMERCI-98COMMERCIAL_WC_PERIODRatio (Trade Receivables + Inventory – Trade Payables)/Daily Sales

GR5: IEONEBIT, NIEONEBI (99%)

Column in R tableCode in textDescription
IEONEBIT-99IEonEBITDARatio Interest Expenses/EBITDA [%]
NIEONEBI-100NIEonEBITDARatio Net Interest Expenses/EBITDA [%]

Using another correlation display from R

This kind of display display gives a “direct” impression of the bi-variate cloud points.
It uses the chart.Correlation() function from the PerformanceAnalytics R package -> https://cran.r-project.org/web/packages/PerformanceAnalytics/index.html

Correlation diagram covering the whole set of ratio variables

chart.Correlation(wcs2train[,c(86:119)], histogram=TRUE, pch=19)

Illustrated in Table_4_19d_Page162_Allvariables_CoorDiag.pdf

Correlation diagram for a select set of variables: ROE, IEONLIAB and V110A

chart.Correlation(wcs2train[,c(86,101,107)], histogram=TRUE, pch=19)

Illustrated in Table_4_19c_Page161_3variables_CoorDiag.pdf

NOTE : From this display, it is apparent that “outliers” play an important role in the charactersization of correlation properties, in particaular in the case of ROE. The subject of “outliers” is dealt with in the next section.