- Introduced by
- Rand R. Wilcox; H. J. Keselman and colleagues
- Year
- 1990s–2000s
- Type
- Robust parametric mean comparison
- Family
- Classical statistics
What does it do?
Robust two-way ANOVA tests the two main effects and the interaction of two crossed categorical factors on a continuous outcome.
It replaces ordinary cell means and pooled variances with trimmed means and Winsorized variances, so it is intended for data where normality, equal cell variances, or the absence of outliers cannot be assumed.
The intuition behind the method
Standard two-way ANOVA relies on ordinary cell means and pooled variance estimates, so a few extreme observations or unequal cell variances can distort both the effect estimates and the error term. The robust version removes a fixed proportion of observations from each tail of each cell and uses the trimmed means as location estimates. It then estimates within-cell variability from Winsorized values, in which the extremes are capped rather than deleted, so the error term is less affected by them. The factorial logic is unchanged: the two main effects and the A×B interaction are each tested as a ratio of effect variability to error variability. What changes is that the comparison is between the central portions of the cell distributions.
History
The trimmed-mean and Winsorized-variance approach is associated with Rand R. Wilcox, whose work on robust estimation and hypothesis testing is collected in his textbook Introduction to Robust Estimation and Hypothesis Testing. Keselman, Wilcox, and Lix (2003) describe trimmed-mean tests with an approximate-degrees-of-freedom heteroskedastic statistic for independent and correlated groups designs and discuss when bootstrap methods improve Type I error control. The WRS2 R package, by Patrick Mair and Rand Wilcox, makes implementations available to applied researchers.
When to use it
Choose robust two-way ANOVA when the outcome is continuous, there are two crossed categorical factors, and at least one standard assumption is doubtful: cell distributions are skewed or heavy-tailed, cell variances clearly differ, or outliers are present and cannot be justified as errors to remove. Behavioral, educational, and medical data often fit this description. Do not use it simply as a default when the assumptions hold, because ordinary two-way ANOVA is more efficient in that case. Avoid it when cells are so small that trimming leaves too few observations for stable trimmed means; the minimum depends on the trimming proportion and the shape of the distributions. If the question involves a single factor, the one-way robust test is the more direct choice.
Limitations and considerations
- Trimming removes observations in every cell, so the effective sample per cell is smaller than the raw count. Designs with modest cell sizes need more raw data than a classical ANOVA would.
- Bootstrap critical values are more appropriate when cells are small or unequal, but they add computation and an additional set of resampling choices to report.
- Results are expressed in terms of trimmed means, which differ from the ordinary averages many readers expect. Trimmed cell means must be reported for the results to be interpretable.
- Interaction patterns can be harder to read when trimmed cell means diverge from ordinary cell means, which happens when cells contain asymmetric or outlying values.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- When errors are non-normal and cell variances are unequal, classical ANOVA can give unreliable Type I error rates. The trimmed-mean approach is designed for these conditions, and the cited Keselman, Wilcox, and Lix (2003) work reports reduced Type I error problems, though its evidence concerns independent and correlated groups designs in general rather than two-way designs specifically.
- With heavy tails or outliers, trimmed means and Winsorized variances keep a few extreme cases from inflating the error term, which can preserve power that classical ANOVA would lose. The size of this gain depends on how heavy the tails are.
- All three factorial effects are tested within one framework, so both main effects and the interaction use the same trimming and Winsorization logic.
- The trimming proportion is a tunable parameter. Smaller proportions keep more data and move the procedure toward the classical estimator, while larger proportions give stronger protection against outliers.
- Implementations exist in R (the WRS2 package, see the FAQ), so the analysis can be scripted and rerun.
Applications
- Reaction-time experiments with two crossed factors, such as task condition and participant group, where times are right-skewed within some cells.
- Clinical or biomarker studies comparing treatment and patient subgroup on a continuous measure when a few cells contain extreme values.
- Educational studies comparing scores across instructional method and school type when score distributions are skewed in some combinations.
- Rating or survey studies with two segmentation factors in which some combinations show much larger spread than others.
How it works
How it works
Three null hypotheses are tested: no main effect of factor A, no main effect of factor B, and no A×B interaction. They are stated in terms of trimmed population locations (the tilde-μ terms in the mechanics formula) rather than ordinary means, so the question concerns the central tendency of the cell distributions.
Formula
H_0: \tilde{\mu}_{A1}=\tilde{\mu}_{A2}=\cdots,\; H_0^B,\; H_0^{AB}Within each cell, observations are sorted and g = ⌊γn⌋ values are removed from each tail, leaving h = n − 2g observations. A trimming proportion of 20% (γ = 0.20) is a commonly used choice. The trimmed cell mean is the average of the retained values, so the most extreme observations in a cell have no direct effect on the location estimate.
Formula
\bar{X}_{t} = \frac{1}{h}\sum_{i=g+1}^{n-g} X_{(i)},\quad h = n - 2g,\quad g = \lfloor \gamma n \rfloorWithin each cell, the values removed by trimming are replaced by the nearest retained values, the lower and upper cutoffs, giving Winsorized observations W_i. The sample variance of these W_i, computed over all n observations, is the within-cell variability used in the error term. Capping the extremes instead of deleting them keeps every observation in the variance calculation.
Formula
S_w^2 = \frac{1}{n-1}\sum_{i=1}^{n}(W_i - \bar{W})^2For each effect, the statistic compares the variability of the trimmed cell means with a heteroskedasticity-robust error term built from the Winsorized variances; the ratio in the mechanics formula is a schematic summary of this idea, not the full computing formula. Following Keselman, Wilcox, and Lix (2003), the approach uses trimmed means with an approximate degrees-of-freedom heteroskedastic statistic, so the reference distribution is not the ordinary pooled-variance F distribution. The exact statistic and degrees-of-freedom rule should be taken from that source or from the software implementation. The same work indicates that bootstrap methods can, in suitable situations, improve Type I error control.
Formula
F_t = \frac{\text{MS}_{\text{effect, trimmed}}}{\text{MS}_{\text{error, Winsorized}}}Each effect's p-value is compared with the chosen significance level α. Rejection indicates that trimmed locations differ across the levels of that factor or combination. For reporting, give the trimmed cell means with their standard errors and the contrast of interest. No single robust effect-size formula is fixed on this page; if you report one, state its exact definition (including the denominator used) and the software or source it comes from.
Formula
\text{reject } H_0 \text{ if } p < \alpha;\quad \xi = \frac{\tilde{\mu}_1 - \tilde{\mu}_2}{\text{robust SE}}Common pitfalls
- Applying the default 20% trimming without checking the data. With nearly symmetric data and no outliers, a smaller proportion or the classical test may be more appropriate, and the choice should be reported and justified.
- The mechanics describe symmetric trimming, with the same g removed from each tail. Asymmetric schemes are not covered by the formula on this page and should not be assumed to follow the same procedure.
- Failing to report the trimming proportion, the Winsorization approach, and whether critical values came from the F distribution or a bootstrap. Without these details the analysis cannot be reproduced.
- Reading only the p-value. Trimmed cell means and a robust effect size are needed to see which differences drive a significant effect.
Frequently asked questions
How does robust two-way ANOVA differ from standard two-way ANOVA?
Standard two-way ANOVA uses ordinary cell means and a pooled error variance. Robust two-way ANOVA uses trimmed means and Winsorized within-cell variances, which limits the influence of outliers and of unequal cell variances. The factorial structure, with two main effects and an interaction, is the same.
What trimming percentage should I use?
The default named on this page is 20% (γ = 0.20), which removes the lowest and highest 20% of observations in each cell. Smaller proportions (5–10%) keep more data and give moderate protection; 20% gives stronger protection against heavy-tailed distributions. A proportion of zero moves the procedure toward the classical analysis, although the test is not identical to the classical F test.
Can I use robust two-way ANOVA with unequal cell sizes?
Yes, but with caution. Unequal cell sizes complicate the estimation of trimmed means and Winsorized variances, and bootstrapped critical values are recommended over the standard F approximation. Check that each cell has enough raw observations before trimming; the page advises a minimum of 15–20 per cell.
How should I report the results?
Report the trimming proportion, the trimmed cell means and their standard errors for each factor combination, the robust F statistic and p-value for each effect, and a robust effect size. The page names ξ and a trimmed-mean contrast divided by the square root of the Winsorized variance; state which exact formula was used.
Which software implements robust two-way ANOVA?
The R package WRS2 (by Mair and Wilcox) provides the t2way() function for independent groups and bwtrim() for mixed designs. Wilcox's own R scripts, available with his textbook, offer additional flexibility. Standard SPSS and SAS procedures do not include trimmed-mean two-way tests natively, but they can be extended with macros.
Related methods
Sources
Wilcox, R. R. (2012). Introduction to Robust Estimation and Hypothesis Testing (3rd ed.). Academic Press.
ISBN: 978-0123869838Keselman, H. J., Wilcox, R. R., & Lix, L. M. (2003). A generally robust approach to hypothesis testing in independent and correlated groups designs. Psychophysiology, 40(4), 586–596.
Open DOI reference