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

xpeng xpeng at utk.edu
Tue Apr 19 17:19:44 CEST 2005


Hi Dren,

I had the similar question, then I wrote my own C program to calculate 
correlation matrices (2-3min for a 8000 x 60 matrix). You can contact with me 
directly (xpeng at utk.edu), it need some extra works to get p-values. I will 
post it somewhere online if there are enough interests.

Best,
Xinxia




  >===== Original Message From Dren Scott <dren_scott at yahoo.com> =====
>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]]
>
>_______________________________________________
>Bioconductor mailing list
>Bioconductor at stat.math.ethz.ch
>https://stat.ethz.ch/mailman/listinfo/bioconductor



More information about the Bioconductor mailing list