Choose your reading route
eduKateSG · Why Mathematics? · Qn Scale Estimation, Pairwise Distances and Robust Spread
Start with the question, audit the worked example, or jump to the assumptions and practice. Every chapter stays open for uninterrupted reading.
Understand the question
Define the quantity and follow the mechanism.Route 2 · Chapters 4–7
Reproduce the example
Audit the numbers one step at a time.Route 3 · Chapters 8–13
Check assumptions
See where design and calibration matter.Route 4 · Chapters 14–18
Explore applications
Connect the method to a concrete investigation.Route 5 · Chapters 19–24
Study and verify
Practise, inspect failure cases and read further.
Full chapter index · Practice and checking · Mathematics Learning Hub
Why is mathematics important when a dataset contains one value that is far from the rest? The answer is not simply “delete the outlier.” A careful analyst needs a measure of spread that remains informative while the unusual value is investigated. The Qn scale estimator does this by using ordered pairwise distances rather than squared distances from the mean.
Qn brings together subtraction, combinations, ordering, robustness and statistical modelling. It also teaches a valuable habit: preserve the data, calculate transparently and distinguish a resistant summary from a decision about whether any observation is wrong.
Did you know? For eight observations there are 8×7÷2 = 28 distinct unordered pairs. Qn turns those many local distances into one robust description of scale.
Full chapter index
Chapters 1–3 · Understand the question
Chapters 4–7 · Reproduce the example
Chapters 8–13 · Check assumptions
Chapters 14–18 · Explore applications
Chapters 19–24 · Study and verify
Qn estimates the typical scale of a quantitative distribution. “Scale” means how widely values vary in their original unit. If measurements are in millimetres, Qn is in millimetres too.
Unlike the sample standard deviation, Qn does not square every distance from a sample mean. It therefore resists the ability of one extremely distant observation to dominate the result.
For n observations, form every absolute pairwise difference |x_i − x_j| with i < j and sort those differences. Let h = floor(n/2) + 1 and k = h(h − 1)/2. The NIST Dataplot definition takes the kth ordered pairwise distance and multiplies it by 2.2219, a consistency factor for normally distributed data.
Written compactly, Qn = 2.2219 × {|x_i − x_j|: i < j}_(k). Software may also apply a documented finite-sample correction. A report should identify its convention because small-sample corrections can change the printed value.
| n | h=floor(n/2)+1 | k=h(h−1)/2 | Pair count |
|---|---|---|---|
| 8 | 5 | 10 | 28 |
Consider 10, 10, 11, 12, 12, 13, 14 and 40. Here n = 8, h = 5 and k = 10. There are 28 pairwise distances.
When sorted, the first ten distances are 0, 0, 1, 1, 1, 1, 1, 1, 1 and 2. The tenth ordered distance is 2, so the uncorrected NIST form gives Qn = 2.2219 × 2 = 4.4438 units.
| Selected distance | Consistency factor | Qn |
|---|---|---|
| 2 | 2.2219 | 4.4438 |
The distances involving 40 are 26, 27, 28, 28, 29, 30 and 30. They lie near the end of the ordered list, far beyond the tenth position that defines Qn.
If 40 is replaced by 400, those seven distances grow dramatically, but the tenth ordered distance remains 2. Qn therefore stays 4.4438 under this convention. That stability is resistance, not proof that 40 or 400 is erroneous.
The number of unordered pairs is “n choose 2,” or n(n − 1)/2. The restriction i < j prevents counting both |x_i − x_j| and |x_j − x_i| and excludes self-distances.
Students can audit a pairwise-distance calculation with a triangular table. Row i needs only values to the right of the diagonal. This makes missing and duplicated pairs easier to spot.
Qn does not average all pairwise distances. An average would still be pulled by the largest distances. Instead, Qn selects a lower ordered distance determined by k.
The mechanism is similar to a quantile: position matters more than the exact size of observations beyond that position. This is why a few extreme distances can move without moving the selected order statistic.
NIST explains that Qn has a 50% breakdown point and a bounded influence function. Informally, a large minority of contaminated observations can be present before the estimator can be driven arbitrarily far.
Breakdown is a mathematical stress property. It does not say that a dataset with 49% problematic values is useful, nor does it replace knowledge about sampling, calibration or measurement quality.
NIST reports about 82% normal efficiency for Qn, compared with about 37% for MAD. Efficiency here concerns sampling variability under a specified normal model.
The figure is not an accuracy guarantee. A biased sampling process can produce a precisely estimated but irrelevant scale. The data-generating process still governs what the statistic can mean.
MAD is the median of |x_i − median(x)|. It measures distances from one central value. Qn instead uses distances between pairs and does not require a centre in its formula.
Both are robust scale estimators. Qn can be attractive when asymmetry makes a centre-based distance less natural, while MAD remains simple to teach and inspect.
Standard deviation is deeply useful when squared deviation, normal modelling or variance decomposition matches the task. Qn answers a different need: a resistant estimate of typical spread.
Analysts often calculate both. A much larger standard deviation than Qn can signal that a few observations or heavy tails deserve inspection, but the contrast alone does not diagnose the cause.
Adding 100 to every observation leaves every pairwise difference unchanged, so Qn is translation invariant. Multiplying every value by 1,000 multiplies Qn by 1,000.
These checks help catch spreadsheet errors. A conversion from metres to millimetres should change the numerical scale by exactly 1,000, while merely changing the origin should not.
Repeated values create zero pairwise distances. Heavy rounding can therefore make Qn smaller or even zero, especially in small datasets.
A zero result may describe coarse resolution rather than perfect repeatability. Record the instrument resolution and retained digits before interpreting the statistic.
With few observations, one ordered distance represents a large step in the empirical distance distribution. Different finite-sample corrections may also matter.
Report n, the consistency factor, any correction and the software version. Reproducibility needs more than the final number.
Give students the eight-value example and ask them to construct all 28 pairwise distances. Then replace 40 with 400 and identify which positions change.
Next replace one of the central values. Students will see that a modest change near the selected position can move Qn more than a spectacular change at the tail. This reveals the estimator’s mechanism.
Store the raw observations in one column. Generate each i < j difference once, apply ABS, sort the results and select position k. Keep the raw pair labels beside each distance so a reviewer can trace the calculation.
Avoid a full square matrix unless duplicate removal is explicit. A triangular extraction is cleaner and lighter.
A simple implementation can generate combinations, sort absolute differences and index k − 1 in zero-based code. Production software should handle missing values, non-numeric input and the chosen finite-sample correction.
Unit-test the eight-value example to obtain a tenth distance of 2 and an uncorrected value of 4.4438. Also test translation and scaling invariance.
Qn does not identify which observation is an outlier. It does not decide whether an observation should be removed, and it does not make non-representative data representative.
It is also not a probability or confidence interval. It is a scale estimate whose interpretation depends on sampling and model assumptions.
CHAPTER 18 OF 24 · Explore applications
18. Applications in science and engineering
Robust spread helps in exploratory measurement studies, sensor comparisons, environmental monitoring and preliminary quality checks where occasional contamination is plausible.
In engineering, a resistant scale can support diagnosis before a formal capability or uncertainty analysis. It should not silently replace the metric required by a specification or standard.
The ISO 13528 Algorithm A guide explains an iterative robust centre and scale for proficiency testing. The Cochran C guide examines whether one variance dominates a group. Qn instead estimates spread directly from ordered pairwise distances.
Students should practise explaining why the estimator is stable, rather than memorising 2.2219. Ask which ordered distance is selected and what happens when a tail value moves.
Parents can reinforce the difference between a resistant calculation and permission to ignore unusual data. Curiosity about the unusual value is part of good mathematics.
Recalculate Qn after changing 14 to 15. Translate every value by −10 and verify invariance. Multiply every value by 2 and predict Qn before computing it. Create a dataset with many ties and explain why the selected distance may be zero.
Compare Qn, MAD and standard deviation for the original data, then write one sentence describing what each measure emphasises.
### Is Qn the same as a quartile of the raw data? No. It is an order statistic of pairwise absolute differences.
### Does a stable Qn prove the extreme value is wrong? No. It only shows that the robust scale estimate is resistant to that value.
### Why multiply by 2.2219? The factor makes the estimator consistent for scale under a normal model in the stated convention.
### Can Qn replace every standard deviation? No. Choose the scale measure that matches the model, decision and reporting requirement.
Read the official NIST Qn scale documentation, the original research article Alternatives to the Median Absolute Deviation and the NIST MAD definition. The worked dataset and calculations here are original.
Explore the Mathematics Learning Hub and How Mathematics Works for related foundations.
Qn makes robust spread tangible. By counting pairs, ordering distances and checking invariance, a student learns how a mathematical design can protect a summary without hiding the data that deserves investigation.
Extended practice laboratory
Practice case 1: List all pairs
Setup: Use the article’s Qn example and change one declared input for case 1. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 2: Verify choose-two count
Setup: Use the article’s Qn example and change one declared input for case 2. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 3: Find h and k
Setup: Use the article’s Qn example and change one declared input for case 3. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 4: Select the kth distance
Setup: Use the article’s Qn example and change one declared input for case 4. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 5: Move the far value
Setup: Use the article’s Qn example and change one declared input for case 5. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 6: Move a central value
Setup: Use the article’s Qn example and change one declared input for case 6. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 7: Translate the dataset
Setup: Use the article’s Qn example and change one declared input for case 7. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 8: Double every value
Setup: Use the article’s Qn example and change one declared input for case 8. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 9: Convert units
Setup: Use the article’s Qn example and change one declared input for case 9. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 10: Add a tie
Setup: Use the article’s Qn example and change one declared input for case 10. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 11: Remove a tie
Setup: Use the article’s Qn example and change one declared input for case 11. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 12: Create zero Qn
Setup: Use the article’s Qn example and change one declared input for case 12. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 13: Compare MAD
Setup: Use the article’s Qn example and change one declared input for case 13. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 14: Compare standard deviation
Setup: Use the article’s Qn example and change one declared input for case 14. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 15: Inspect asymmetry
Setup: Use the article’s Qn example and change one declared input for case 15. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 16: Audit finite correction
Setup: Use the article’s Qn example and change one declared input for case 16. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 17: Audit software version
Setup: Use the article’s Qn example and change one declared input for case 17. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 18: Handle missing data
Setup: Use the article’s Qn example and change one declared input for case 18. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 19: Plot pairwise distances
Setup: Use the article’s Qn example and change one declared input for case 19. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 20: Check instrument resolution
Setup: Use the article’s Qn example and change one declared input for case 20. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 21: Test small n
Setup: Use the article’s Qn example and change one declared input for case 21. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 22: Investigate contamination
Setup: Use the article’s Qn example and change one declared input for case 22. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 23: Explain breakdown carefully
Setup: Use the article’s Qn example and change one declared input for case 23. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.
Practice case 24: Write a robust-scale conclusion
Setup: Use the article’s Qn example and change one declared input for case 24. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.
Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.