calculate p-value for the r pairwise
1
0
Entering edit mode
7.8 years ago
Edalat ▴ 30

hello all,

I calculated correlation by this function for control and tumor:

control.corr=cor(cod[grep(".C",cod$name),-1],nc[grep(".C",nc$name),-1],method = "spearman") tumor.corr=cor(cod[grep(".T",cod$name),-1],nc[grep(".T",nc$name),-1],method = "spearman")

so I have two matrix of r pairwise, now I want calculate p-value for the r's, what should I do?

pvalue correlation • 3.5k views
ADD COMMENT
0
Entering edit mode
7.8 years ago

cor.test()

ADD COMMENT
1
Entering edit mode

To be specific,

control.corrP=cor.test(cod[grep(".C",cod$name),-1],nc[grep(".C",nc$name),-1],method = "spearman")$p.value 

tumor.corrP=cor.test(cod[grep(".T",cod$name),-1],nc[grep(".T",nc$name),-1],method = "spearman")$p.value
ADD REPLY
0
Entering edit mode

thank you,this is what I want ;-)

ADD REPLY
0
Entering edit mode

control.corrP=cor.test(coding.rpkm[grep("23.C",coding.rpkm$name),-1],ncoding.rpkm[grep("23.C",ncoding.rpkm$name),-1],method = "spearman")$p.value

Error in cor.test.default(coding.rpkm[grep("23.C", coding.rpkm$name), : 'x' and 'y' must have the same length

there is an error,why? it is clear that the number of coding and ncoding are not same.

ADD REPLY
0
Entering edit mode

The length of coding.rpkm[grep("23.C",coding.rpkm$name),-1] vector differs from the length of ncoding.rpkm[grep("23.C",ncoding.rpkm$name),-1] vector. You'll need to make sure both vector are of the same length

ADD REPLY
0
Entering edit mode

yes the number of genes in coding and noncoding are different and with this difference I calculate correlation,how can I do that?!

ADD REPLY
0
Entering edit mode

how can you perform a pairwise correlation if you don't have data of equal length? You won't even have the pairwise R, right?

ADD REPLY
0
Entering edit mode

I think in your case correlation analysis will not be meaningful. I can suggest t-test or Kruskal Wallis statistics.

Note: if you have more number of samples (example 10), you can use correlation of individual coding and noncoding expression with respect to 10 samples ( this will make sense because you will have same number of samples in both case).

ADD REPLY

Login before adding your answer.

Traffic: 1804 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