Choose your reading route
eduKateSG · Why Mathematics? · Gini Mean Difference, Pairwise Absolute Gaps and Location-Free 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–26
Study and verify
Practise, inspect failure cases and read further.
Full chapter index · Practice and checking · Mathematics Learning Hub
Why is mathematics important when spread should be measured without first choosing a centre? The Gini mean difference calculates the absolute gap between every unordered pair of observations and averages those gaps. It describes how far apart two distinct sample values are on average.
The method connects combinations, absolute value, efficient summation and dispersion. It also clarifies that the word “Gini” can refer to different quantities: this article is about the Gini mean difference, not an income-inequality coefficient calculated from shares.
Did you know? Four observations create six unordered pairs. Every pair becomes a small comparison, and their average becomes one location-free measure of spread.
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–26 · Study and verify
Standard deviation measures squared distances from a mean. MAD measures distances from a median. Gini mean difference, or GMD, uses distances between observations directly.
It therefore does not depend on a chosen location estimator.
For n observations, NIST defines GMD = 2/[n(n−1)] times the sum of |x_i−x_j| over all i>j. Because n(n−1)/2 is the number of unordered pairs, this is simply the average pairwise absolute difference.
The result has the same unit as the data.
| Data | Pair count | Absolute gaps |
|---|---|---|
| 1, 2, 4, 8 | 6 | 1, 3, 7, 2, 6, 4 |
Consider 1, 2, 4 and 8. The six unordered absolute gaps are 1, 3, 7, 2, 6 and 4.
Their sum is 23. Dividing by six gives GMD = 23/6 ≈ 3.833333 units.
| Gap sum | Pair count | GMD |
|---|---|---|
| 23 | 6 | 23/6 = 3.833333 |
The number of unordered pairs is n choose 2 = n(n−1)/2. For n=4, that is 6.
Counting first prevents missing pairs or double-counting both (i,j) and (j,i).
Signed differences would cancel: a positive difference in one direction becomes negative when the order is reversed. Absolute value keeps magnitude and removes direction.
GMD is therefore non-negative and equals zero only when all observations are identical.
Imagine selecting two distinct sample observations without order. GMD is the average absolute gap across all such selections.
This interpretation is often easier to explain than squared units.
Standard deviation squares residuals, giving large gaps extra influence. GMD uses absolute pairwise gaps, so influence grows linearly with distance.
Neither statistic is universally superior. Variance-based models and pairwise-distance questions support different choices.
Both use pairwise absolute distances. GMD averages every distance, whereas Qn selects a lower ordered distance and is more resistant to a small number of extreme pairs.
The Qn guide explains that resistant order-statistic mechanism.
Sn constructs a median distance around each observation and then takes a median of those values. GMD gives every pair equal weight in one average.
The Sn guide shows how nested medians change tail influence.
If 8 becomes 80, the three gaps involving it become much larger and GMD rises. The statistic is not high-breakdown robust.
Its advantage is transparent linear pairwise averaging, not immunity to contamination.
Adding the same constant to every observation leaves every pairwise gap unchanged. Multiplying all values by a positive factor multiplies GMD by that factor.
These properties are useful implementation checks.
Generating every pair requires order n squared work and storage if done naively. NIST also gives a sorted-data formula using adjacent gaps and combinatorial weights.
Efficient algorithms matter when n is large, but a small triangular pair table is best for teaching and audits.
Repeated values contribute zero gaps. Heavy rounding can therefore reduce GMD.
Record measurement resolution and do not interpret a small value as perfect physical consistency without context.
Define the analysis set before constructing pairs. Dependent repeated measurements can make the pair interpretation different from independent units.
Preserve subject or batch identifiers where dependence matters.
Students can place 1, 2, 4 and 8 on a number line and draw all six connecting segments. Label each length and average them.
Then move 8 to 80 and identify exactly which three gaps change.
Create a triangular table of absolute differences with row and column IDs. Sum each unordered pair once and divide by the pair count.
Add a check that the table contains n(n−1)/2 non-diagonal entries.
For small samples, iterate over combinations of two observations. For large samples, use a verified sorted-data algorithm to avoid materialising all pairs.
Unit-test 1,2,4,8 to obtain sum 23, pair count 6 and GMD 3.833333.
A sample GMD is a point estimate. Confidence intervals require a sampling model, large-sample theory or a justified resampling design.
Do not attach a standard-deviation formula automatically.
GMD is not the same as the Gini coefficient and does not automatically measure inequality in a policy sense. It is a dispersion statistic in the data’s unit.
It does not detect outliers or repair biased sampling.
Pairwise absolute spread appears in statistics, economics, quality analysis and model evaluation. Similar distance averages occur in machine learning and clustering.
The transferable skill is translating a global summary into auditable pair comparisons.
The biweight-scale guide uses residual weights and cutoffs. The midmean guide describes central-half location rather than overall pairwise spread.
Students should count the pairs before calculating and explain why the denominator is the pair count rather than n.
Parents can ask whether extreme values and repeated measurements were inspected alongside the summary.
Find GMD for 2, 2 and 8. Add 10 to every value and verify invariance. Double every value and predict the result.
Compare GMD and Qn after replacing the largest observation by a much larger value.
### Does GMD need a mean or median? No. It is built directly from pairwise gaps.
### Is GMD robust to extreme values? It grows linearly rather than quadratically, but every extreme pair still contributes.
### Are ordered pairs counted twice? No. The standard formula averages unordered distinct pairs once.
### Is it an inequality index? This statistic is a mean absolute difference; related Gini inequality measures use additional normalisation.
Read the official NIST Gini mean difference documentation, the NIST measures-of-scale handbook and the NIST Qn documentation. The worked pair list is original.
Explore the Mathematics Learning Hub and How Mathematics Works for related foundations.
Gini mean difference makes spread a conversation between every pair of observations. Its simple absolute gaps help students see exactly how a dispersion summary is assembled.
Extended practice laboratory
Practice case 1: List all pairs
Setup: Use the article’s GMD 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: Count choose-two
Setup: Use the article’s GMD 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: Calculate absolute gaps
Setup: Use the article’s GMD 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: Sum the gaps
Setup: Use the article’s GMD 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: Average the gaps
Setup: Use the article’s GMD 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 the largest value
Setup: Use the article’s GMD 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: Add a tie
Setup: Use the article’s GMD 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: Translate all values
Setup: Use the article’s GMD 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: Scale all values
Setup: Use the article’s GMD 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: Compare standard deviation
Setup: Use the article’s GMD 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: Compare Qn
Setup: Use the article’s GMD 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: Compare Sn
Setup: Use the article’s GMD 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: Check location independence
Setup: Use the article’s GMD 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: Use sorted formula
Setup: Use the article’s GMD 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: Use large n
Setup: Use the article’s GMD 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: Preserve pair IDs
Setup: Use the article’s GMD 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: Handle missing data
Setup: Use the article’s GMD 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 dependence
Setup: Use the article’s GMD 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 pair gaps
Setup: Use the article’s GMD 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: Estimate uncertainty
Setup: Use the article’s GMD 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: Check units
Setup: Use the article’s GMD 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: Avoid Gini-coefficient confusion
Setup: Use the article’s GMD 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 tail sensitivity
Setup: Use the article’s GMD 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 dispersion conclusion
Setup: Use the article’s GMD 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.