Interactive demo · Statistical Methods for Modern Biology · Chapter 3

The empirical CDF, its confidence band, and QQ plots

The empirical cumulative distribution function Fn(x) is the fraction of observations at or below x. Unlike a histogram or a density estimate it needs no tuning, and it converges to the true F uniformly (Glivenko–Cantelli): by the Dvoretzky–Kiefer–Wolfowitz inequality, the band Fn ± ε with ε = √(ln(2/α)/(2n)) contains the whole of F with probability at least 1 − α, whatever F is. The right panel plots the sorted data against normal quantiles: a straight line means a normal shape, an S or a bend means heavy tails, skewness or several modes.

Data

Sample size n (simulation)

Band level 1 − α

Read-out

Try these

For a gene, the reference F is the normal distribution with the sample mean and standard deviation (dashed), so the distance shown is the Kolmogorov–Smirnov statistic against a fitted normal (its p-value from ks.test would be too large, because the parameters were estimated). QQ plot positions are R's ppoints: (i − a)/(n + 1 − 2a) with a = 3/8 for n ≤ 10 and 1/2 otherwise; the line passes through the quartiles, as qqline does.

In the lecture notes