Source: Tamhane/Dunlop Ch. 5, Sec. 6.1, 14.6.2, 15.1
Tags: sample Q-Q plot, two-sample comparison, mixture distribution, normal mixture, box plot, box-and-whiskers, IQR, interquartile range, outlier detection, fences, hinges, heavy tails, kernel density estimator
Two-sample Q-Q plots compare the distributions of two datasets by plotting their sample quantiles against each other. The shape of the resulting curve tells you whether the distributions are identical, from the same family, or fundamentally different. Box plots summarise distributions via quartiles and flag outliers using fences set at 1.5 * IQR from the hinges. The expected number of outliers depends heavily on the underlying distribution, not just on sample size.
Two-sample Q-Q plot
A plot of (Q-hat_X(u_i), Q-hat_Y(u_i)) for i = 1, ..., n = min(n_1, n_2). Compares the distributions of two independent samples.
Interquartile range (IQR)
Q-hat_3 - Q-hat_1, i.e. the difference between the 75th and 25th sample percentiles. Measures the spread of the middle 50% of the data.
Hinges
The first and third sample quartiles, Q-hat_1 = Q-hat(0.25) and Q-hat_3 = Q-hat(0.75). They form the left and right edges of the box in a box plot.
Fences (inner)
Lower fence: Q-hat_1 - 1.5 IQR (or X_(1), whichever is larger). Upper fence: Q-hat_3 + 1.5 IQR (or X_(n), whichever is smaller). Data beyond the fences are flagged as potential outliers.
Outer fences
Lower outer fence: Q-hat_1 - 3 IQR. Upper outer fence: Q-hat_3 + 3 IQR. Points between the inner and outer fences are mild outliers; points beyond the outer fences are extreme outliers.
Whiskers
Lines extending from Q-hat_1 and Q-hat_3 to the most extreme data values that are still inside the inner fences.
Mixture distribution
A population made up of k subpopulations with PDFs f_1, ..., f_k in proportions p_1, ..., p_k. The overall PDF is f_Y(y) = sum of p_i * f_i(y).
Kernel density estimator
A smoothed estimate of the PDF, f-hat_Y, used to look for multiple modes in the data. Its appearance is sensitive to the choice of bandwidth.
Given samples X_1, ..., X_{n1} from F_X and Y_1, ..., Y_{n2} from F_Y, take n = min(n_1, n_2) and plot:
(Q-hat_X(u_i), Q-hat_Y(u_i)) for u_i = (i - 0.5)/n, i = 1, ..., n
When sample sizes differ, the quantile for the larger sample is interpolated.
Case 1: Points close to a 45-degree line through the origin
Conclude F_X and F_Y are the same distribution (or very nearly so)
Q_X(u) = Q_Y(u) for all u if and only if F_X = F_Y
Case 2: Points close to a straight line (not necessarily 45 degrees)
If F_X belongs to a location-scale family, conclude F_Y belongs to the same family
The relationship is Y = beta_0 + beta_1 * X in distribution
If Q_X(u) = theta_1 + theta_2 Q_Z(u), then Q_Y(u) = (beta_0 + beta_1 theta_1) + beta_1 theta_2 Q_Z(u)
So Y's distribution is in the same location-scale family, with shifted location and rescaled scale
Case 3: Points close to a non-linear curve
If Q-hat_Y(u_i) = h(Q-hat_X(u_i)) for some function h, there is evidence that the distributions of X and Y are related by that function
Important: this is a distributional relationship, not a relationship between the actual data values. X could be pulse rates and Y could be tensile strengths; they share a distributional form, not a causal link
Case 4: Points not close to any straight line
You cannot conclude the distributions are from different families
They might still belong to the same family but with different shape parameters (e.g. two Weibulls with different gamma values are not related by a linear Q-Q relationship)
X = (3, 6, 7, 10, 12), n_1 = 5 and W = (2, 4, 6, 10, 14, 22, 26, 29), n_2 = 8.
Take n = min(5, 8) = 5. For i = 1, ..., 5: u_i = (i - 0.5)/5 = 0.1, 0.3, 0.5, 0.7, 0.9.
Q-hat_X(u_i) = X_(i) = (3, 6, 7, 10, 12) since n_1 = n
Q-hat_W(u_i) requires interpolation from n_2 = 8 order statistics: (2.6, 5.8, 12, 22.4, 28.1)
Plot the five points: (3, 2.6), (6, 5.8), (7, 12), (10, 22.4), (12, 28.1)
A population with k subpopulations has PDF:
f_Y(y) = p_1 f_1(y) + p_2 f_2(y) + ... + p_k * f_k(y)
Mean of the mixture:
mu_Y = sum of p_i * mu_i
Variance of the mixture:
sigma²_Y = sum of p_i (sigma²_i + mu²_i) - (sum of p_i mu_i)²
This simplifies to sigma²_Y = sum of p_i * sigma²_i only when all subpopulation means are equal (mu_1 = mu_2 = ... = mu_k).
Note that the mixture variance is generally not a simple weighted average of the component variances. The between-group variation in means inflates the overall variance.
Two graphical approaches:
Plot the kernel density estimator f-hat_Y and look for multiple modes (bumps). The problem is that modes can appear or vanish as you change the bandwidth, so choosing the right bandwidth is critical.
Plot Q-hat(y) vs y and look for jumps or flat regions. A jump in the sample quantile plot may or may not reflect a true discontinuity in the population quantile.
No, in general. Even when all subpopulations are normal:
If the means differ (Case 1), the mixture is clearly non-normal (can be bimodal or skewed)
If the means are equal but variances differ (Cases 2 and 3), the mixture PDF is more peaked than the normal with the same overall mean and variance
Only when all means and all variances are identical does the mixture remain normal, but then there is no real mixing
The handout illustrates four mixing scenarios with equal means but different variance weightings (sigma = 1, 3, 5, 9). In every case the mixture PDF is more peaked than the corresponding normal, regardless of whether the proportions are equal or unequal.
A box-and-whiskers plot uses three quartiles:
Q-hat_1 = Q-hat(0.25), Q-hat_2 = Q-hat(0.50), Q-hat_3 = Q-hat(0.75)
The box spans from Q-hat_1 to Q-hat_3
A line inside the box marks the median Q-hat_2
The sample mean is often shown with a "+" symbol
Whiskers extend from the hinges to the most extreme values inside the fences
Points beyond the fences are plotted individually as potential outliers (often asterisks)
Symmetric distribution: whiskers of equal length, median centred in box, roughly equal outliers on both sides
Right-skewed distribution: longer upper whisker, median closer to Q-hat_1, more outliers above the upper fence
Heavy-tailed symmetric distribution: whiskers of equal length, median centred, but a large proportion of outliers on both sides
Short-tailed symmetric distribution: whiskers of equal length, median centred, very few or no outliers
Multi-modal distribution: the box plot will not reveal the multiple modes (this is a limitation)
An observation Y is an outlier if:
Y < Q_1 - 1.5 IQR or Y > Q_3 + 1.5 IQR
When the CDF is known (Case 1):
P[outlier] = F_Y(Q_1 - 1.5 IQR) + 1 - F_Y(Q_3 + 1.5 IQR)
When Y belongs to a location-scale family (Case 2):
The probability of being an outlier depends only on the standard member of the family, not on the location or scale parameters. This is because IQR_Y = theta_2 * IQR_Z, and the standardisation cancels all theta_1 and theta_2 terms:
P[outlier] = F_Z(Q_Z(0.25) - 1.5 IQR_Z) + 1 - F_Z(Q_Z(0.75) + 1.5 IQR_Z)
Distribution | P[Outlier] | Expected outliers in n=100 | Expected outliers in n=1000 |
|---|---|---|---|
Normal | 0.007 | 0.7 | 7 |
Logistic | 0.024 | 2.4 | 24.4 |
Double Exponential | 0.063 | 6.3 | 62.5 |
Cauchy | 0.156 | 15.6 | 156 |
For symmetric distributions with location parameter = 0: P[outlier] = 2 F_Y(4 Q(0.25)).
For the Weibull family, the probability of an outlier depends on the shape parameter gamma, not just the scale alpha:
Weibull(gamma = 2, alpha = 5): P[outlier] = 0.0103
Weibull(gamma = 2, alpha = 1.18): P[outlier] = 0.0103 (same gamma, different alpha, same probability)
Weibull(gamma = 0.2, alpha = 1.18): P[outlier] = 0.1892 (different gamma, different probability)
Weibull(gamma = 0.2, alpha = 5): P[outlier] = 0.1892 (same gamma as above, same probability)
The key conclusion: for non-location-scale families, outlier probability can vary across members of the family, but it only changes when the shape parameter changes.
Two-sample Q-Q plotting coordinates:
u_i = (i - 0.5) / n, n = min(n_1, n_2)
Mixture PDF:
f_Y(y) = sum_{i=1}^{k} p_i * f_i(y)
Mixture variance:
sigma²_Y = sum p_i (sigma²_i + mu²_i) - (sum p_i mu_i)²
Outlier probability (location-scale family, symmetric, location = 0):
P[outlier] = 2 F_Y(4 Q(0.25))
Normal Q(0.25): -0.6745
Logistic Q(0.25): -1.0986
Double Exponential Q(0.25): -0.9093
Cauchy Q(0.25): -1.0
⚠️ In a two-sample Q-Q plot, points on a straight line (not necessarily 45 degrees) indicate the same distributional family only if F_X is from a location-scale family. If shape parameters differ, the Q-Q plot will curve even within the same family.
⚠️ The mixture variance formula is not a simple weighted average of variances. The (sum p_i * mu_i)² correction term accounts for between-group mean differences. This is a common exam trap.
⚠️ Mixing normals with equal means but different variances does not produce a normal distribution. The result is always more peaked.
⚠️ For location-scale families, the probability of an outlier is the same for every member. For non-location-scale families (e.g. Weibull), it varies with the shape parameter. Know this distinction.
⚠️ Box plots cannot detect multimodality. If you suspect a mixture, use a kernel density plot or a Q-Q plot instead.
⚠️ Heavy-tailed distributions produce many more outliers in a box plot than the normal. Do not automatically treat flagged outliers as errors; consider whether the data might come from a heavy-tailed distribution.
Q: In a two-sample Q-Q plot, the points fall along a line with slope 2 and intercept 5. Both samples are believed to come from normal distributions. What can you conclude?
A: Since the normal family is a location-scale family, a straight-line Q-Q relationship means both samples come from the normal family. The Y-sample has a mean that is shifted by beta_0 = 5 relative to the X-sample and a standard deviation that is 2 times larger (beta_1 = 2).
Q: You generate a box plot from 1000 observations and see about 150 outliers on both sides. Is something wrong with the data?
A: Not necessarily. A Cauchy distribution has P[outlier] = 0.156, which predicts about 156 outliers in 1000 observations. The data may come from a heavy-tailed distribution. Check a Q-Q plot to confirm.
Q: A population is 15% N(25, 1) and 85% N(30, 9). What is the mean of the mixture?
A: mu_Y = 0.15 25 + 0.85 30 = 3.75 + 25.5 = 29.25.
Q: For any member of the normal family, what is the probability that a randomly drawn observation is classified as a box plot outlier?
A: 0.007 (about 0.7%). This is the same for all normal distributions regardless of mu and sigma because the normal family is a location-scale family.
Q: In a two-sample Q-Q plot, the points follow a clear non-linear curve Q-hat_Y(u) = h(Q-hat_X(u)). Can you conclude that Y = h(X) for the actual observed values?
A: No. The Q-Q plot relates the distributions of X and Y, not the individual data values. X and Y could measure completely unrelated things (e.g. pulse rates and tensile strengths) yet have distributions connected by the function h.
Q: Why does the mixture of normal distributions with equal means but different variances not produce a normal distribution?
A: Because the mixture PDF is a weighted sum of normal PDFs with different spreads. The result has heavier tails and a sharper peak than any single normal with the same overall mean and variance. A normal distribution is uniquely determined by its mean and variance, and the mixture does not match that shape.
two-sample Q-Q plot, quantile comparison, sample quantile, location-scale comparison, distributional equivalence, mixture distribution, normal mixture, multimodal, kernel density estimator, bandwidth, box plot, box-and-whiskers, interquartile range, IQR, hinges, fences, inner fence, outer fence, mild outlier, extreme outlier, whiskers, outlier detection, outlier probability, expected outlier count, Cauchy outliers, heavy-tailed distribution, Weibull outlier, shape parameter, STAT 301, Principles of Statistics I, Texas A&M