Biostar Beta. Not for public use.
calculate p-value for the r pairwise
0
Entering edit mode
3.1 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 • 1.4k views
ADD COMMENTlink
0
Entering edit mode
13 months ago
London

cor.test()

ADD COMMENTlink
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 REPLYlink
0
Entering edit mode

thank you,this is what I want ;-)

ADD REPLYlink
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 REPLYlink
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 REPLYlink
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 REPLYlink
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 REPLYlink
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 REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.3.1