[BioC] Pearson correlation and p-values for a matrix

Dren Scott dren_scott at yahoo.com
Mon Apr 18 19:52:51 CEST 2005


Hi All,
 
I was trying to calculate the pearson correlation (and p-value) for a gene dataset ( 6000 rows x 10 columns). For each row vector, I wanted to calculate the p-value with respect to the other row vectors. My resulting p-value matrix should be of size 6000 x 6000.
 
I tried the iterative approach:
 

for(i in 1:nrow(data)){

   for(j in i:nrow(data)){

         p_value <- cor.test(data[i,],data[j,])$p.value

         pmatrix[j,i] <- pmatrix[i,j] <- p_value

   }

}

 

But this will take too long for nrow(data) = 6000. Is there some method by which I can pass the matrix into a function to get the p-values? The dataset would also have some/many NA's.

 

thanks,

 

Dren


		
---------------------------------


	[[alternative HTML version deleted]]



More information about the Bioconductor mailing list