Mathwords logoMathwords

Quantile-Quantile Plot — Definition, Formula & Example

A quantile-quantile plot (Q-Q plot) is a graph that lines up the sorted values of a data set against the values a model distribution predicts. If the model fits, the points fall close to a straight line.

Let x(1)≤x(2)≤⋯≤x(n)x_{(1)} \le x_{(2)} \le \dots \le x_{(n)} be the order statistics of a sample, and let FF be a continuous model CDF with quantile function F−1F^{-1}. A Q-Q plot graphs the points (F−1(pi), x(i))\left(F^{-1}(p_i),\, x_{(i)}\right) for i=1,…,ni = 1, \dots, n, where pip_i is a plotting position such as in+1\frac{i}{n+1} or i−0.5n\frac{i - 0.5}{n}. Linearity indicates the sample is consistent with FF up to a location and scale change. Some texts swap the axes or use other plotting positions.

Key Formula

(F−1(pi),  x(i)),pi=in+1,i=1,2,…,n\left(F^{-1}(p_i),\; x_{(i)}\right), \qquad p_i = \frac{i}{n+1}, \quad i = 1, 2, \dots, n
Where:
  • x(i)x_{(i)} = The i-th smallest data value (order statistic)
  • F−1F^{-1} = Quantile function (inverse CDF) of the model distribution
  • pip_i = Plotting position: the probability assigned to the i-th ordered value
  • nn = Sample size

How It Works

Sort the data, assign each value a probability pip_i, and find the model's quantile at each pip_i. Plot the model quantiles on the horizontal axis and the sorted data on the vertical axis. Points along a straight line suggest a good fit. A bow-shaped curve signals skewness. An S-shape, with the ends bending away from the line, means the data's tails are lighter or heavier than the model's. When the model's parameters are fully specified, both axes are in data units, so you can read the size of any misfit directly.

Worked Example

Problem: A bus arrives every 20 minutes. If riders show up at random times, wait time follows a uniform distribution on 0 to 20 minutes, with quantile function Q(p)=20pQ(p) = 20p. Four riders wait 9, 17, 3, and 12 minutes. Build a Q-Q plot and judge the fit.
Step 1: Sort the data and assign plotting positions with n=4n = 4, so pi=i5p_i = \frac{i}{5}.
x(i):3, 9, 12, 17pi:0.2, 0.4, 0.6, 0.8x_{(i)}: 3,\ 9,\ 12,\ 17 \qquad p_i: 0.2,\ 0.4,\ 0.6,\ 0.8
Step 2: Find the model quantile at each plotting position using Q(p)=20pQ(p) = 20p.
Q(0.2)=4,Q(0.4)=8,Q(0.6)=12,Q(0.8)=16Q(0.2) = 4,\quad Q(0.4) = 8,\quad Q(0.6) = 12,\quad Q(0.8) = 16
Step 3: Plot the pairs (model quantile, data value) and compare them with the line y=xy = x. Each vertical gap is measured in minutes.
3−4=−1,9−8=1,12−12=0,17−16=13 - 4 = -1,\quad 9 - 8 = 1,\quad 12 - 12 = 0,\quad 17 - 16 = 1
Answer: The points are (4, 3), (8, 9), (12, 12), and (16, 17). Each one lies within 1 minute of the line y = x, so the wait times are consistent with the uniform model. Four points give only weak evidence, though.

Why It Matters

In a regression or intro statistics course, you use a normal Q-Q plot of residuals to check the normality assumption behind t-tests and confidence intervals. Risk analysts use Q-Q plots to spot heavy tails in stock returns. In those data, extreme losses happen far more often than a normal model predicts.

Common Mistakes

Mistake: Deciding a normal Q-Q plot shows a bad fit because the points do not lie on the line y = x.
Correction: When you plot data against standard normal quantiles, any straight line indicates normality. The intercept estimates the mean and the slope estimates the standard deviation. The line y = x applies only when the model's parameters are fully specified, as in the bus example.

Related Terms

  • P-P Plot — Compares cumulative probabilities instead of quantiles, less sensitive in tails
  • Residual Plot — Regression diagnostic often paired with a Q-Q plot of residuals
  • Scatter Plot — The point-plotting format a Q-Q plot is built on
  • Box Plot — Summarizes a few quantiles, while Q-Q plots use all
  • Normal Probability Plot — The Q-Q plot against a normal model
  • Parameter (Statistics) — Q-Q line intercept and slope estimate location and scale parameters
  • Quantile — The cut points plotted on each axis