This is a test version of Biostars. For the public version, visit https://www.biostars.org.
calculate p-value for the r pairwise

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 answer

cor.test()

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

thank you,this is what I want ;-)

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.

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

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

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?

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).

Log in to answer this question.