Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's a good strategy to get a decent overview of big correlation matrices or pairs?

Tags:

r

Often some data.frame contains 20+ variables and you want to get a first overview (of the correlation structure). Even on a 30" screen you run quickly out of space and it remains hard to grasp the message. Are there any established strategies to highlight what's important? I am aware this question is somewhat general, but I wondered over and over again and never had the panacea to cure it. And yup, I heard of summary.

like image 724
Matt Bannert Avatar asked Sep 29 '11 12:09

Matt Bannert


People also ask

How do you visualize a large correlation matrix?

You can use qgraph to visualize a correlation matrix as a network. This will plot variables as nodes and correlations as edges connecting the nodes. Green edges indicate positive correlations and red edges indicate negative correlations. The wider and more saturated the edges the stronger the absolute correlation.

What is a correlation matrix good for?

A correlation matrix is simply a table which displays the correlation coefficients for different variables. The matrix depicts the correlation between all the possible pairs of values in a table. It is a powerful tool to summarize a large dataset and to identify and visualize patterns in the given data.


1 Answers

Well I just have to post about my own package here:)

You can use qgraph to visualize a correlation matrix as a network. This will plot variables as nodes and correlations as edges connecting the nodes. Green edges indicate positive correlations and red edges indicate negative correlations. The wider and more saturated the edges the stronger the absolute correlation.

For example (this is the first example from the help page), the following code will plot the correlation matrix of a 240 variable dataset.

library("qgraph") data(big5) data(big5groups) qgraph(cor(big5),minimum=0.25,cut=0.4,vsize=2,groups=big5groups,legend=TRUE,borders=FALSE) title("Big 5 correlations",line=-2,cex.main=2) 

enter image description here

You can also cluster strongly correlated nodes together (uses Fruchterman-Reingold) which creates quite a clear image of what the structure of your correlation matrix actually looks like:

enter image description here

And alot more. For some more examples take a look at my site:

http://sachaepskamp.com/?page_id=73

like image 195
Sacha Epskamp Avatar answered Oct 04 '22 10:10

Sacha Epskamp