Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

correlation matrix to build networks

Tags:

r

I have used the MixOmics package in R for a two matrices (canonical correlation analysis) and I have a resultant correlation matrix. I would like to build a correlation network from the result obtained. I earlier thought of using the gene set correlation analysis package but I do not know how to install it and there are no sources over the internet to install it in R (http://www.biostat.wisc.edu/~kendzior/GSCA/).

Also could you suggest what other packages I could use to build networks with correlation matrix as input ?? I thought of Rgraphviz but do not know if it is possible.

like image 440
Stacey John Avatar asked Sep 11 '12 16:09

Stacey John


People also ask

What is correlation in networking?

Correlation-based network analysis (CNA) is based on mathematically defined (dis)similarity measures that correlate different components to each other and the resulting correlation coefficients reflect the magnitude of the co-linear relationship of the components.

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

Copying this answer mostly from my previous answer at https://stackoverflow.com/a/7600901/567015

The qgraph package is mostly intended to visualize correlation matrices 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

For an extensive introduction take a look at http://www.jstatsoft.org/v48/i04/paper

like image 106
Sacha Epskamp Avatar answered Oct 19 '22 22:10

Sacha Epskamp