Entering edit mode
7.9 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?
To be specific,
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 ofncoding.rpkm[grep("23.C",ncoding.rpkm$name),-1]
vector. You'll need to make sure both vector are of the same lengthyes 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.