WGCNA - Intramodular Connectivity
1
0
Entering edit mode
4.0 years ago

Hi,

In the following command what is and why we put: use="p". I have been searching it but I haven't found out anything.

ADJ1=abs(cor(DatExprs,use="p"))^6

If someone can help me, I would appreciate!

Thanks,

Silvia

wgcna intramodular-connectivity • 902 views
ADD COMMENT
1
Entering edit mode
4.0 years ago

Hola Silvia,

use is a parameter passed to the cor() function, and 'p' relates to 'pairwise.complete.obs'. WGCNA uses cor() to create the correlation matrix.

If you type this at your command prompt, you will see more information:

?cor

'pairwise.complete.obs' means that we will only include values that are complete across our logical entities that are being correlated.

A quick example:

x <- c(1,2,3,4)
y <- c(5,6,7,7)

If we correlate x and y, we can see that the correlation will be close to 1:

cor(x, y, use = 'p')
[1] 0.9438798

If, however, we introduce an NA in the 4th variable, then that 4th variable will be excluded from the correlation and we will then observe a perfect correlation:

x <- c(1,2,3,4)
y <- c(5,6,7,NA)
cor(x, y, use = 'p')
[1] 1

By the way, I view it as good practice to always fully reference parameter values, so, always use:

cor(..., use = 'pairwise.complete.obs')

Kevin

ADD COMMENT
0
Entering edit mode

Oh, okay

Thank you!!!

ADD REPLY

Login before adding your answer.

Traffic: 1691 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6