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 be the order statistics of a sample, and let be a continuous model CDF with quantile function . A Q-Q plot graphs the points for , where is a plotting position such as or . Linearity indicates the sample is consistent with up to a location and scale change. Some texts swap the axes or use other plotting positions.
Key Formula
Where:
- = The i-th smallest data value (order statistic)
- = Quantile function (inverse CDF) of the model distribution
- = Plotting position: the probability assigned to the i-th ordered value
- = Sample size
How It Works
Sort the data, assign each value a probability , and find the model's quantile at each . 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 . 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 , so .
Step 2: Find the model quantile at each plotting position using .
Step 3: Plot the pairs (model quantile, data value) and compare them with the line . Each vertical gap is measured in minutes.
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.
