Choose your reading route
eduKateSG · Why Mathematics? · Median Polish, Row–Column Effects and Resistant Residuals
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 a table varies across both rows and columns, and a few cells may be unusual? Median polish repeatedly removes row and column medians, leaving a common level, additive effects and residuals. It is a robust way to expose structure in a multi-factor table.
The method connects medians, subtraction, iteration and model residuals. It also teaches an essential modelling limit: an additive decomposition does not automatically capture interactions.
Did you know? Median polish is called “polish” because each pass removes another layer of row and column pattern from the table until the remaining residual structure changes little.
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
Suppose rows represent laboratories and columns represent methods, times or materials. A cell can be high because its row tends high, its column tends high, both, or because that cell behaves unusually.
Median polish separates these additive components using medians rather than means.
NIST writes data = common value + factor effects + residual. For two factors, this becomes common + row effect + column effect + residual.
Its implementation can extend to one through five factors, but it does not compute interaction terms.
| Row | Column 1 | Column 2 | Column 3 |
|---|---|---|---|
| A | 10 | 12 | 14 |
| B | 20 | 22 | 40 |
Consider row A: 10, 12, 14 and row B: 20, 22, 40. The final cell is deliberately high relative to the simple additive pattern.
Begin one transparent row-and-column sweep by finding each row median.
| Quantity | Row A | Row B |
|---|---|---|
| Row medians | 12 | 22 |
| Final residuals | 0, 0, −8 | 0, 0, 8 |
Row A has median 12 and becomes −2, 0, 2 after subtraction. Row B has median 22 and becomes −2, 0, 18.
The accumulated row effects are therefore 12 and 22 in this uncentred teaching pass.
The residual column medians are −2, 0 and 10. Subtracting them leaves row A residuals 0, 0, −8 and row B residuals 0, 0, 8.
The additive prediction for A-column3 is 12 + 10 = 22, leaving 14 − 22 = −8. For B-column3 it is 22 + 10 = 32, leaving 40 − 32 = 8.
The third column contains opposite residuals after additive row and column patterns are removed. That suggests a row-by-column interaction or another cell-specific mechanism.
Median polish exposes the pattern; it does not decide its cause.
Formal median-polish software repeatedly centres and accumulates effects, often reporting a grand-median common term plus centred row and column effects.
Adding a constant to all row effects and subtracting it from the common term leaves fitted values unchanged. Compare fitted values and residuals, not parameter labels alone.
NIST alternates factor-level medians and subtraction until a residual-change ratio is below a cutoff. Often only a few passes are needed.
The worked table reaches zero row and column medians after the displayed sweep, though the residual interaction remains.
A mean row effect can be pulled strongly by one large cell. The median row effect depends on the middle order position and is more resistant.
Repeated median removal carries that resistance through the additive decomposition.
The model assumes row and column effects add. If one row responds differently across columns, residuals can show a patterned interaction.
NIST notes that its median-polish command does not calculate interaction terms. Residual inspection is therefore essential.
NIST’s Dataplot median polish can work with balanced or unbalanced designs. The meaning of a cell summary still depends on how many raw observations and what uncertainty lie behind it.
Do not treat a sparse cell mean as equally reliable without review.
Median polish can use raw data or one summary per cell. If summaries are used, the choice of mean, median or other statistic becomes another modelling decision.
Preserve cell counts and within-cell variability.
Missing combinations can complicate interpretation and convergence. A software result should state how missing values were handled.
Do not fill cells with convenient zeros unless zero is a genuine observation.
Adding 100 to every cell changes the common term by 100 while leaving row contrasts, column contrasts and residuals unchanged under an equivalent parameterisation.
This is a useful check of the decomposition.
Students can write row medians beside the table, subtract them, then write column medians below the residual table. Colour the final ±8 pair.
Ask whether a row effect, column effect or interaction best describes that remaining pattern.
Create a new residual table for every pass. Store row medians, column medians and accumulated effects separately.
Never overwrite the raw table. Stop only under a stated convergence rule.
Represent factor levels explicitly, compute medians by level, subtract, accumulate effects and iterate. Return fitted values, residuals, convergence information and cell counts.
Unit-test the teaching sweep to produce final residuals [0,0,−8] and [0,0,8].
Plot residuals by row and column, inspect large cells and look for structured signs. A residual heatmap can reveal interaction patterns hidden by a single summary.
Residuals are evidence for follow-up, not automatic exclusions.
Median polish is not a robust replacement for every ANOVA, does not create causal effects and does not model interactions automatically.
It also cannot rescue confounded factors or non-representative sampling.
Median polish is useful in exploratory experiments, interlaboratory tables, agriculture, manufacturing and other multi-factor settings. Similar additive decompositions appear in recommender systems and data normalisation.
The transferable skill is separating main patterns from residual structure.
The Mandel h and k guide examines laboratory-level consistency. The Youden-plot guide uses two results to separate persistent and run-specific patterns. Median polish extends robust decomposition across factor tables.
Students should narrate each subtraction: what pattern was removed, and what residual remains? This turns a table algorithm into reasoning.
Parents can encourage the habit of checking residuals rather than trusting only fitted effects.
Perform one sweep on rows [5,7,9] and [15,17,31]. Add 10 to every cell and verify residual invariance. Create a perfectly additive table and show that residuals vanish.
Construct a table with an interaction and explain the residual pattern.
### Is median polish the same as taking the median of all cells? No. It repeatedly removes factor-level medians and analyses residuals.
### Does it estimate interactions? The cited NIST command does not; interactions can remain as residual patterns.
### Can it handle more than two factors? NIST documents one through five factors, though interpretation becomes more complex.
### Are the effects causal? No. Causality depends on study design and assumptions, not the decomposition alone.
Read the official NIST Dataplot median-polish manual, the NIST exploratory-data handbook and the NIST measures-of-location page. The worked table and uncentred teaching sweep are original and explicitly labelled.
Explore the Mathematics Learning Hub and How Mathematics Works for related foundations.
Median polish shows how repeated subtraction can reveal structure. By separating additive row and column patterns from residuals, mathematics helps a student see what a table explains and what it still leaves unanswered.
Extended practice laboratory
Practice case 1: Find row medians
Setup: Use the article’s median-polish 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: Subtract row medians
Setup: Use the article’s median-polish 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 column medians
Setup: Use the article’s median-polish 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: Subtract column medians
Setup: Use the article’s median-polish 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: Accumulate row effects
Setup: Use the article’s median-polish 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: Accumulate column effects
Setup: Use the article’s median-polish 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: Compute fitted cells
Setup: Use the article’s median-polish 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: Compute residual cells
Setup: Use the article’s median-polish 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: Check residual medians
Setup: Use the article’s median-polish 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: Run another pass
Setup: Use the article’s median-polish 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: Add a constant
Setup: Use the article’s median-polish 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: Scale the table
Setup: Use the article’s median-polish 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: Create an additive table
Setup: Use the article’s median-polish 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: Create an interaction
Setup: Use the article’s median-polish 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 a large residual
Setup: Use the article’s median-polish 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: Plot residual heatmap
Setup: Use the article’s median-polish 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 cells
Setup: Use the article’s median-polish 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 unbalanced cells
Setup: Use the article’s median-polish 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: Preserve cell counts
Setup: Use the article’s median-polish 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: Compare ANOVA carefully
Setup: Use the article’s median-polish 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: Audit convergence
Setup: Use the article’s median-polish 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 causal claims
Setup: Use the article’s median-polish 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: Name the model limit
Setup: Use the article’s median-polish 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 table-decomposition conclusion
Setup: Use the article’s median-polish 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.