Skip to content

Checking fit with Q–Q plots

Line your data up against a distribution and read the pattern. See why a plot often beats a normality test.

Applied ~11 min9 steps

What runs in CodeSplash

You will be able to

  • Read skew and heavy tails from a Q–Q plot
  • Say why a normality test can mislead at both small and large n
  • Compare candidate distributions with AIC and goodness of fit

Read first

01

Two lists, side by side

Read

A Q–Q plotQ–Q plotPlots your data's quantiles against a reference distribution's; points on the line mean the shapes match. sorts your data and plots each value against the matching quantile of a reference distribution. If the data come from that distribution, the points fall along a straight line.

You don't need to judge a shape by eye. You judge whether a line is straight, which people do very well.

Normal Q–Q plotIs a variable (or a set of residuals) approximately normal, and where does it depart?
View data
residual
12.030
12.730
12.050
11.050
14.390
8.810
8.720
10.120
−12.530
7.840
12.620
9.670
9.460
4.730
9.430
10.990
10.770
5.770
7.130
11.320
8.440
11.200
13.010
7.980
12.130
11.090
11.050
12.950
8.590
13.150
10.540
2.260
6.510
7.720
7
12.790
8.330
13.230
10.180
11.580
9.800
5.410
9.680
14.120
7.420
1.440
16.020
15.470
8.660
13.800
5.300
6.890
7.410
4.260
3.360
11.810
9.150
10.380
10.830
13.260

First 60 of 200 rows.

This example uses the built-in data in Charts. The button opens the recipe, where you can read its guide and change its controls.

02

Build one

Explore

Predict the pattern first. Then change Skewness ε and Tail weight δ, and connect each shape with its pattern. Lower Sample size n and see how much a small sample wanders, even with no real departure.

AExplorable · Build a Q–Q plot

How do skewness and heavy tails show up in a normal Q–Q plot?

Before plotting: what pattern will the points make?

How sure?
0.80
1.00

Below 1: heavier tails.

80

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

03

Name the pattern

Read
What you seeWhat it means
Points on the lineCompatible with the reference
Curve bending up at both endsRight skew
Curve bending down at both endsLeft skew
S shape, steep at the endsHeavy tails
S shape, flat at the endsLight tails
04

A plot or a test?

Predict

Predict first

Your data have a mild skew that barely affects a t test. With n=1,000n = 1{,}000, how often does a Shapiro–Wilk test reject normality?

It rarely rejects: the skew is mildIt rejects almost every timeIt rejects about 5% of the time
Reveal

Almost every time, at a large enough nn. With a sample that large it detects departures too small to matter, while at small nn it can miss large ones. The test answers "is this exactly normal?", and that isn't your question.

05

See the paradox

Explore

Compare the rejection rates at small and large nn with the t test's Type I error. Find a departure where Shapiro–Wilk nearly always rejects at n=1,000n = 1{,}000, while the t test stays close to its promised rate.

AExplorable · The normality-test paradox

Why is a normality test least helpful exactly when you might rely on it?

How often does Shapiro–Wilk reject this skew at n = 1,000?

0.50
How sure?
0.05
Simulating…

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

06

Fix it, or fit another family

Read

Ozone's skewness is 1.24. A Box–Cox transformation with λ = 0.20 brings it to −0.02, and the Shapiro–Wilk p moves from p < .001 to p = .340.

Or fit another family. For a set of lifetimes, AIC prefers the gamma distribution, and its goodness-of-fit test gives p = .410: compatible with that fit.

07

Check your reading

Checkpoint

Check yourself

On a normal Q–Q plot the points lie close to the line in the middle, and bend sharply upward at the right end only. What does that suggest?

Show the answer

Answer: a

Points above the line at the right end mean the largest values exceed what the reference predicts. Small wiggles at the ends are normal, so judge them against the band.

Check yourself

With 8 data points, a Shapiro–Wilk test gives p = 0.60. What can you conclude?

Show the answer

Answer: b

A large p at small nn is no evidence of normality. Use a Q–Q plot and what you know about the process that produced the data.

Check yourself

For fuel economy (mpg) in the mtcars data, what is the Shapiro–Wilk W? Give two decimals.

Show the answer

Answer: 0.947564726479274

It's close to 1, with . W measures how straight the Q–Q plot is.

08

Check a column in the app

In the app

On a numeric column's page in Insights, Which distribution is this? compares the candidates for you, with Q–Q plots. In Analyze, run a normality test or a battery, and fit families directly.

Python
import pandas as pd
from scipy import stats
import matplotlib.pyplot as plt

ozone = pd.read_csv("airquality.csv")["Ozone"].dropna()
stats.probplot(ozone, dist="norm", plot=plt)
plt.savefig("ozone-qq.png")
print(stats.shapiro(ozone))
R
ozone <- na.omit(read.csv("airquality.csv")$Ozone)
png("ozone-qq.png")
qqnorm(ozone)
qqline(ozone)
dev.off()
shapiro.test(ozone)
09

Recap

Recap
  • A Q–Q plot compares your data with a reference. A straight line means compatible.
  • Bends show skew, and S shapes show tails.
  • Normality tests over-react at large nn and under-react at small nn. Ask whether a departure matters for your method.

Concepts in this lesson