I'm examining correlations in a data set with a large number of variables but small sample sizes. To get a feel for how these quantities behave, I generated some random data and looked at the distribution of correlations:
n = 4 y = matrix(rnorm(1000 * n), 1000, n) x = matrix(rnorm(1000 * n), 1000, n) p = as.numeric(cor(t(x),t(y))) hist(p)
To my surprise, the distribution is almost perfectly uniform:
Does anyone have an explanation for this phenomenon? It makes some sense in that for n=2 we have either p=1 or p=-1, and as n->infinity the distribution becomes normal, so this distribution falls somewhere inbetween. But why uniform? I'm stumped.