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:
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:
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$.