Winsorized Mean Calculator
Statistics
- Inputs: the values sum to 1247.50; the 2 smallest sum to 96.20 (cap 52.40) and the 2 largest to 388.30 (cap 121.70), out of 20 values.
- Winsorized sum: 1247.50 - 96.20 - 388.30 + 2 x 52.40 + 2 x 121.70 = 1111.20.
- Winsorized mean: 1111.20 / 20 = 55.56.
- Winsorized mean result: 55.56 against an untrimmed mean of 62.38.
Winsorizing answers the same problem as trimming - extreme values with too much leverage over the mean - with the opposite surgery. Instead of deleting the k smallest and k largest values, it replaces each of them with the nearest value that survives: the smallest values are pulled up to the (k+1)-th value, the largest pulled down to the (n-k)-th. The extremes stop dominating, but they stay in the count, and the sample size - with everything that hangs on it, from standard errors to degrees of freedom - is untouched.
This calculator works from the summary form: the total sum, the two tail sums, the two cap values those tails are replaced by, the count and k. It returns the winsorized mean, the winsorized sum and the untrimmed mean for comparison. The worked examples use the same three datasets as the trimmed mean page, deliberately, so the two surgeries can be compared cut for cut.
Worked examples
Winsorizing 2 of 20
(1247.5 · 96.2 · 52.4 · 388.3 · 121.7 · 20 · 2)
| Winsorized mean | 55.56 |
| Untrimmed mean (all values) | 62.38 |
| Winsorized sum | 1111.20 |
| Values replaced at each end | 2 |
Winsorizing 1 of 12 with honest extremes
(438.6 · 33.8 · 41.5 · 88.9 · 76.4 · 12 · 1)
| Winsorized mean | 36.15 |
| Untrimmed mean (all values) | 36.55 |
| Winsorized sum | 433.80 |
| Values replaced at each end | 1 |
Winsorizing 4 of 40 at scale
(5210.4 · 512.8 · 141.9 · 940.6 · 208.3 · 40 · 4)
| Winsorized mean | 128.95 |
| Untrimmed mean (all values) | 130.26 |
| Winsorized sum | 5157.80 |
| Values replaced at each end | 4 |
Pull in, don't delete
The statistic is named for Charles Winsor, the biostatistician who proposed it, and its logic is the logic of the benefit of the doubt. A trimmed analysis declares the extreme values worthless and discards them. A winsorized analysis declares them suspicious but not void: the largest observation probably is large, just not that large, so it is credited with the size of the largest value nobody doubts. Rank information survives; magnitude is disciplined.
The arithmetic from summary sums adds the caps back in place of the tails. In the first worked example the same 20 values that sum to 1247.50 have their 2 smallest, summing to 96.20, replaced by twice the lower cap of 52.40, and their 2 largest, summing to 388.30, replaced by twice the upper cap of 121.70. The winsorized sum is 1111.20, and divided by the full count of 20 - not a reduced count - the winsorized mean is 55.56.
Set the centres side by side and the philosophy shows: the untrimmed mean is 62.38, hostage to the tails; the trimmed mean, on its own page, sits lower still, having executed the extremes; the winsorized mean is 55.56, having demoted them. Which is right depends on what you believe the extremes are - errors, or genuine values from a heavy-tailed process that merely need their influence rationed.
- Winsorized mean = (total - tail sums + k x lower cap + k x upper cap) / n.
- The count never changes: every value stays in the average, extremes at their caps.
- Caps are the (k+1)-th and (n-k)-th ordered values, the nearest retained observations.
- Winsorizing preserves degrees of freedom, which is why robust t-tests use it.
Winsorizing from summary sums
The inputs reward a second look, because they differ from the trimmed page's by exactly the two cap values. The tail sums say what is being removed; the caps say what replaces it. In the second worked example the single smallest value sums to 33.80 and is replaced by the cap of 41.50, while the largest, 88.90, is replaced by 76.40: the winsorized sum is 433.80 over the full 12 values and the winsorized mean is 36.15, a whisper below the untrimmed 36.55 - on this dataset the extremes were nearly honest, and winsorizing says so.
The third example scales the same operation: 40 values, 4 replaced at each end, caps of 141.90 and 208.30 standing in for tail sums of 512.80 and 940.60. The winsorized sum is 5157.80 and the mean 128.95, against an untrimmed 130.26. Note the ordering - at scale, with a tenth of the data capped, the winsorized mean stays close to the raw mean, while trimming the same data walks the centre much further away.
Gathering the caps is the one step that needs the ordered data or a cooperative report: the cap is an actual observed value, the first one inside the cut. If a source gives you tail sums but not caps, the winsorized mean cannot be reconstructed - one of the few practical advantages trimming holds over it.
| Example | Values | Replaced at each end | Winsorized mean | Untrimmed mean |
|---|---|---|---|---|
| First | 20 | 2 | 55.56 | 62.38 |
| Second | 12 | 1 | 36.15 | 36.55 |
| Third | 40 | 4 | 128.95 | 130.26 |
Worked examples
Example 1: Sum of all values 1247.5; Sum of the k smallest values 96.2; Lower cap value (the (k+1)-th value) 52.4; Sum of the k largest values 388.3; Upper cap value (the (n-k)-th value) 121.7; Number of values (n) 20; Values replaced at each end (k) 2. Winsorized mean = 55.56. Supporting values: Untrimmed mean (all values) 62.38; Winsorized sum 1111.20; Values replaced at each end 2. Inputs: the values sum to 1247.50; the 2 smallest sum to 96.20 (cap 52.40) and the 2 largest to 388.30 (cap 121.70), out of 20 values. Winsorized sum: 1247.50 - 96.20 - 388.30 + 2 x 52.40 + 2 x 121.70 = 1111.20. Winsorized mean: 1111.20 / 20 = 55.56. Winsorized mean result: 55.56 against an untrimmed mean of 62.38.
Example 2: Sum of all values 438.6; Sum of the k smallest values 33.8; Lower cap value (the (k+1)-th value) 41.5; Sum of the k largest values 88.9; Upper cap value (the (n-k)-th value) 76.4; Number of values (n) 12; Values replaced at each end (k) 1. Winsorized mean = 36.15. Supporting values: Untrimmed mean (all values) 36.55; Winsorized sum 433.80; Values replaced at each end 1. Inputs: the values sum to 438.60; the 1 smallest sum to 33.80 (cap 41.50) and the 1 largest to 88.90 (cap 76.40), out of 12 values. Winsorized sum: 438.60 - 33.80 - 88.90 + 1 x 41.50 + 1 x 76.40 = 433.80. Winsorized mean: 433.80 / 12 = 36.15. Winsorized mean result: 36.15 against an untrimmed mean of 36.55.
Example 3: Sum of all values 5210.4; Sum of the k smallest values 512.8; Lower cap value (the (k+1)-th value) 141.9; Sum of the k largest values 940.6; Upper cap value (the (n-k)-th value) 208.3; Number of values (n) 40; Values replaced at each end (k) 4. Winsorized mean = 128.95. Supporting values: Untrimmed mean (all values) 130.26; Winsorized sum 5157.80; Values replaced at each end 4. Inputs: the values sum to 5210.40; the 4 smallest sum to 512.80 (cap 141.90) and the 4 largest to 940.60 (cap 208.30), out of 40 values. Winsorized sum: 5210.40 - 512.80 - 940.60 + 4 x 141.90 + 4 x 208.30 = 5157.80. Winsorized mean: 5157.80 / 40 = 128.95. Winsorized mean result: 128.95 against an untrimmed mean of 130.26.
Why robust testing prefers winsorizing
The winsorized mean's killer feature is not the mean itself but what it enables downstream. A trimmed mean's standard error must account for the discarded values and the reduced count, which complicates every test built on it. Winsorizing keeps n intact, so the winsorized variance and the winsorized t-test - standard tools in robust statistics for comparing two groups with outlier-prone data - run on the original degrees of freedom with the extremes' influence rationed rather than removed.
That is why the technique persists in fields with small samples and dirty measurements: psychology experiments, clinical biomarkers, environmental assays. In a sample of 12, like the second example, deleting 2 values is a sixth of the evidence; capping them keeps the design whole. The price is the one visible in the first example - the winsorized centre stays closer to the contaminated mean, because the extremes still vote, just with capped ballots.
Choosing k and the caps honestly
The discipline mirrors trimming's: k is chosen by rule, in advance - a fixed count or a fixed proportion such as the tenth used in the first and third examples - and reported with the result. The caps are then determined by the data, not chosen: they are the nearest retained values by construction, and any hand-picked cap is no longer winsorizing but editing.
A diagnostic worth running is the comparison this page prints by default. When the winsorized and untrimmed means nearly coincide, as in the second and third examples, the extremes were not driving the result and the robustification was free insurance. When they diverge, as in the first, the honest report gives both numbers and lets the reader see the size of the judgement the caps embody.
When winsorizing is the wrong surgery
If the extreme values are known errors - mis-keyed digits, sensor faults, unit mix-ups - capping them is too kind: a wrong value pulled in to the cap still pulls the mean toward the error, and deletion or correction is the right response. Winsorizing is for values you believe are genuine but outsized, from a process whose tails you distrust in magnitude, not in existence.
It also inherits the symmetry assumption. Winsorizing a genuinely skewed distribution at both ends caps the informative long tail while barely touching the short one, bending the centre downward. For skewed data, transform first or use the median; winsorizing, like trimming, is built for a symmetric bulk with heavy tails, and inside that remit it is usually the gentler and better tool.
FAQs
What is a winsorized mean?
The mean after replacing the k smallest values with the (k+1)-th value and the k largest with the (n-k)-th, instead of deleting them. The extremes keep their rank but lose their magnitude, and the count - and degrees of freedom - stay intact.
What winsorized mean does the first worked example give?
The 20 values sum to 1247.50. Replacing the 2 smallest (96.20) with twice the 52.40 cap and the 2 largest (388.30) with twice the 121.70 cap gives a winsorized sum of 1111.20, and over the full count of 20, a mean of 55.56.
How does winsorizing differ from trimming?
Trimming deletes the extremes and divides by the reduced count; winsorizing caps them and divides by the full count. On the first dataset winsorizing gives 55.56 against an untrimmed mean of 62.38, and trimming the same data goes further still - winsorizing is the gentler surgery.
Why do robust t-tests use winsorized values?
Because the count never changes. The winsorized variance and t-test run on the original degrees of freedom with the extremes' influence rationed, which keeps small-sample inference workable where trimming's discarded values complicate it.
What are the cap values, exactly?
The nearest values that are not replaced: the (k+1)-th smallest and the (n-k)-th. They are observed data values determined by k, never hand-picked - in the third example they are 141.90 and 208.30, standing in for tail sums of 512.80 and 940.60.
When should I trim instead of winsorize?
When the extremes are known errors rather than genuine outsized values. A mis-keyed figure capped at the boundary still drags the mean toward the error; deletion or correction is cleaner. Winsorizing is for tails you distrust in size, not in existence.