The Signature Correlogram in R

<<< Click here to go back

There are various interesting variants of Correlograms :

1. Colorful one

data_1 = mtcars
corrgram(data_1, order=FALSE, lower.panel=panel.shade,
                                                    upper.panel=panel.pie, text.panel=panel.txt,
                             main="Give your header here")

Click to enlarge

The blue color here tells the positive correlation and red one tells the negative one. Color intensity shows the strength of correlation.

You can interchange the change the position of lower and upper panels:

corrgram(data_1, order=FALSE, lower.panel=panel.pie,
                                                    upper.panel=panel.shade, text.panel=panel.txt,
                             main="Give you header here")

If you use order = TRUE option that R will reorder the variables using principal component analysis of the correlation matrix. Basically more correlated variables together.

panel.txt shows variable names.

Apart from the shade and pie, other interesting options are also available.

Try this one too :

2. Less glamourous but more informative

corrgram(mtcars, order=TRUE, lower.panel=panel.ellipse,
         upper.panel=panel.pts, text.panel=panel.txt,
         main="Give your header here")

Click to enlarge
The above variant is quite useful in understanding the patter of scatter of variables pairs and also the transformation need, if any.
If you want only one panel, you can simple make the other one as "NULL":

corrgram(data_1, order=FALSE, lower.panel=panel.shade,
         upper.panel=NULL, text.panel=panel.txt,
         main="Give your header here")

You can try various variants and make your deliverable super cool.

Enjoy reading our other articles and stay tuned with us.

Kindly do provide your feedback in the 'Comments' Section and share as much as possible.

No comments:

Post a Comment

Do provide us your feedback, it would help us serve your better.