Question: calculate p-value for the r pairwise
0
gravatar for Edalat
3.3 years ago by
Edalat30
Edalat30 wrote:

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?

correlation pvalue • 1.7k views
ADD COMMENTlink modified 3.3 years ago by andrew.j.skelton735.9k • written 3.3 years ago by Edalat30
0
gravatar for andrew.j.skelton73
3.3 years ago by
London
andrew.j.skelton735.9k wrote:

cor.test()

ADD COMMENTlink written 3.3 years ago by andrew.j.skelton735.9k
1

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 modified 3.3 years ago • written 3.3 years ago by EagleEye6.6k

thank you,this is what I want ;-)

ADD REPLYlink written 3.3 years ago by Edalat30

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 modified 3.3 years ago • written 3.3 years ago by Edalat30

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 written 3.3 years ago by Sam2.7k

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 modified 3.3 years ago • written 3.3 years ago by Edalat30

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 written 3.3 years ago by Sam2.7k

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 modified 3.3 years ago • written 3.3 years ago by EagleEye6.6k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1886 users visited in the last hour