Hi all,

I am comparing two bed files to find correlation between them.now to examine that whether the correlation is occurring by chance or it is meaningful correlation, in order that I have randomized bed file to 1KB upstream and downstream against which I am finding correlation. now I want to find find P value for the same.

A and B are two bed file. A corr B is 0.9 and A corr C is 0.2 . Here how P value will be calculated.

C - randomized B to 1kb

I would really appreciate any help.
<p>If I understand well, u want to get a pvalue assessing the significance of a correlation.</p>

<p>Using random permutation is a good idea. However you should do the randomization many times in order to have an empirical distribution of the (A,C) correlation. From that distribution, you can then get the significance of your (A,B) correlation.</p>

<p>Good luck !</p>

<p>Edit : The statistical test to use will depend on your distribution. If it is normal (you can use a normality test to make sure of that), then you could compute the mean, standard deviation and pvalue like this (with R) :</p>

<pre>
#rand_corr = vector of random correlations
#here for testing, 10000 random number with 0.2 mean and 0.2 sd
rand_corr=(rnorm(10000,0.2,0.2))

# pval calculation :

mean &lt;- mean(rand_corr) #mean of random (A,C) correlations
sd &lt;- sd(rand_corr) #sd of random correlation
x &lt;- 0.9 #true (A,B) correlation value
z &lt;- (x-mean)/(sd) #center normalize
2*pnorm(-abs(z))  # return pval

# visual representation :

hist(rand_corr, breaks=30)
abline(v=x, col=&quot;red&quot;)</pre>

<p>However if the normality is not respected (it might not be since you have correlation values that cannot go below 0 or higher than 1), you might need to ressort to other tests.</p>
