# How are percentiles distributed?

I was taking a look at this page, and I can't seem to understand why the frequency plot of the percentiles is uniformly distributed. Distances between percentiles are not equal, so why is the histogram relatively uniform?

Percentiles: • rb612: Let $Y=F_X(X)$ for some continuous invertible $F$. $P(Y\leq y) = P(F_X(X)\leq y) = P(X\leq F_X^{-1}(y)) = F_X(F_X^{-1}(y)) = y$. Hence $F_X(X)$ is uniform Aug 8, 2015 at 10:04
• @Stephane I saw it after I replied. Hang on I'll delete the comment; but leave your reply to me here so you don't have everyone doing what I did. Aug 8, 2015 at 10:07
• I deleted what needed deletion. If you want to delete the first comment, you can; I would then delete everything under it except my comment to rb612 Aug 8, 2015 at 12:20

Take uniformly distributed vector $U$ and cumulative distribution function $F$ of some distribution, then you can transform $F^{-1}(U) = X$ to get continuous random variable $X$ having $F$ CDF.

This is often used in generating random variables using inverse transform sampling, that enables us to generate random variable with any distribution starting with a vector of random variable $U$.

You can see an example below, where $U$ is passed through CDF functions of Normal distribution, $t$-distribution, Uniform distribution, and Beta.

U <- seq(0, 1, by = 0.01)
plot(qnorm(U), U, type = "l", xlab="")
lines(qt(U, 3), U, col = "red")
lines(qunif(U), U, col = "blue")
lines(qbeta(U, 3, 7), U, col = "green") As you can see, $U$ is always the same and uniformly distributed, while the CDF's differ a lot.

This relation is used, for example, in equipercentile equating in educational research, where having scores on test $X$ you can transform them to scale of test $Y$ so that both tests share common scale. Since $F^{-1}(U) = X$ is valid for continuous random variables, in methods as equipercentile equating discrete scores are continized so for this property to hold.

This leads to $F(X) = U$, i.e. percentiles are uniformly distributed. Below you can see an example where Normally distributed random variable $X$ is transformed using inverse CDF and the resulting variable $U$ is uniformly distributed.

X <- rnorm(1e5)
hist(pnorm(X)) If you want an intuitive example, let's consider a very simple case of Bernoulli distribution with two possible states $\{0, 1\}$, that have probabilities $1-p$ and $p$. If you want to sample from this distribution, you can take a line $U$ that starts at $0$ and ends at $1$ and choose some points at this line at random. Then for points lower or equal to $1-p$ set $X$'s to $0$'s and for values greater than $1-p$ set $X$'s to $1$'s. The sample obtained this way will be Bernoulli distributed with parameter $p$.

• @StéphaneLaurent right, but it is often still applicable also in other cases. I edited to be more precise.
– Tim
Aug 8, 2015 at 8:26
• Tim, I think there's still a confusion at the beginning. The inverse sampling is not restricted to continuous distributions. Aug 8, 2015 at 15:36
• @StéphaneLaurent This is why I wrote that it is used for any distribution. But maybe there was too many changes and it got unclear.
– Tim
Aug 8, 2015 at 15:48