While learning on the q-value
http://www.totallab.com/products/samespots/support/faq/pq-values.aspx
I saw that, under the null-hypothesis, the distribution of the p-value is expected to be uniform.
I made up a simple t-test between two Gaussian samples, and do not understand the results:
If one sample is fixed and the other is random, then the p-value distribution is not uniform:
R
s0 = rnorm( n = 100, mean=0, sd=1 )
vec = c()
for( i in 1:10000 ){
s1 = rnorm( n = 100, mean=0, sd=1 )
t = t.test( x=s0, y=s1 )
p = t$p.value
vec = c( vec, p )
}
hist(vec, breaks=seq(0,1,0.01))
But if the two samples are random, then the distribution is uniform:
R
vec = c()
for( i in 1:10000 ){
s0 = rnorm( n = 100, mean=0, sd=1 )
s1 = rnorm( n = 100, mean=0, sd=1 )
t = t.test( x=s0, y=s1 )
p = t$p.value
vec = c( vec, p )
}
hist(vec, breaks=seq(0,1,0.01))
I don't catch here the link with the "null-hypothesis", any enlightening explanation is welcome!