What to do with skewed data and outliers? (robust procedures: trimmed means, Yuen test, winsorizing)
In brief
A trimmed mean drops a fixed share at both ends of the ordered values (usually 20%) and averages the rest. Extreme values hardly disturb it. The Yuen test compares two groups with trimmed means, the robust analysis of variance several. The result stays a difference of means, with an interval.
Robust or rank test?
Robust instead of a rank test fits when the discussion should stay with means (the difference is given in units of the measure, with an interval) but the data are skewed or contain outliers. The rank test compares only the order of the values; it fits when the measure is only ordinal or the distances between values mean nothing.
How it works in Statable
- Run the card "Do groups differ?" or "Has something changed?".
- Under the result at "Assumption of a normal distribution" choose "Robust (trimmed means)".
- Choose the trimming per side (default 20%). Two groups: Yuen test; paired: Yuen test for paired values; three or more groups: robust analysis of variance with pairwise comparisons.
Reading the result
- The table shows for each "Group" the "Values in the mean" (so many values remain after trimming) and the "Trimmed mean". This is the figure compared in place of the ordinary mean.
- For two groups the "Yuen test" follows, for paired values the "Yuen test for paired values": the "Difference of the trimmed means", the "95% interval", t with degrees of freedom and p. The difference is in the unit of your measure. If the interval excludes 0, the difference of the trimmed means is not explained by chance alone.
- For three or more groups the "Robust analysis of variance (trimmed)" with F and p is shown. Below, the "Pairwise comparisons of the trimmed means" give for each "Comparison" the "Difference", "p (raw)" and "p (after Hochberg)". Read the adjusted p; it takes into account that several pairs are tested.
- The table further up still shows the ordinary test. If the two differ a lot, outliers or skewness drive the difference; the robust row then counts for more.
- Typical misreading: reading the trimmed mean as "mean without outliers" and reporting the ordinary mean. Report what was calculated: the trimmed mean with the trimming. Statable warns if too few values remain after trimming (at least 2 per group).
An example
Tooth growth in guinea pigs (ToothGrowth), orange juice against vitamin C, 30 animals each, 20% trimmed: difference of the trimmed means 5.12, t(33.49) = 2.29, p = .029, interval [0.57, 9.68]. Plant growth (PlantGrowth), three groups: F(2, 9.64) = 8.28, p = .008; adjusted by Hochberg, treatment 1 and 2 differ (p = .007).
Winsorizing as a data step
Under "Edit data" there is "Winsorize": values below the lower and above the upper percentile (default 20% and 80%) are set to these limits. The result goes into a new column, the original column stays. Winsorizing appears in the log. It deletes nothing but changes values and must therefore always be reported: percentiles, limit values and the number of changed values.
- Page "Data", "Edit data", then at the top in the group "Change values" choose "Winsorizing".
- At "Which column?" choose the number column. At "Lower limit (percentile in %)" and "Upper limit (percentile in %)" enter the limits. At "Name of the new column" give a name.
- The preview and the "Notes" show how many values change (below and above) and which limits apply. Then press "Winsorizing". "Undo" in the header takes the step back.
How it is calculated
- Trimmed mean: floor(trimming · n) values are dropped per side. The spread is the winsorized variance: the dropped values are replaced by the nearest remaining value.
- Yuen test: Welch-like degrees of freedom from the winsorized variances and the number of remaining values.
- Pairwise comparisons: p values adjusted by Hochberg (as in the R package WRS2); confidence intervals of the pairwise comparisons are missing.
What is often misunderstood
Trimming is not deleting the outliers from the data: it changes what is compared (the trimmed mean, not the ordinary one). The trimming therefore belongs in the report. With very small groups all procedures remain uncertain.
Reporting the result
Report: why a robust method was used (skewed data, outliers), the trimming per side, the method (Yuen test, paired Yuen test or robust analysis of variance with pairwise comparisons by Hochberg), the group sizes, the difference of the trimmed means with t and degrees of freedom (usually not a whole number), p and 95% interval. If winsorizing was done, percentiles, limit values and the number of changed values belong with it. Also: fix the trimming in advance and do not choose it after the result. Method: Yuen 1974, Biometrika 61, 165-170; Wilcox 2022, Introduction to robust estimation and hypothesis testing (5th ed.); implemented as in the R package WRS2 (Mair & Wilcox 2020, Behavior Research Methods 52, 464-488).
Because of [skewed distribution/outliers] the groups were compared with 20% trimmed means (Yuen test; n₁ = …, n₂ = …): difference of the trimmed means = …, t(…) = …, p = …, 95% CI […, …]. With three or more groups: robust analysis of variance, F(…, …) = …, p = …, pairwise comparisons adjusted by Hochberg. Winsorizing was done at the percentiles … and …; … values were changed.
Sources
Wilcox, R. R. (2022). Introduction to robust estimation and hypothesis testing (5th ed.). Academic Press. Yuen, K. K. (1974). The two-sample trimmed t for unequal population variances. Biometrika, 61, 165-170. Mair, P. & Wilcox, R. (2020). Robust statistical methods in R using the WRS2 package. Behavior Research Methods, 52, 464-488.