Scheirer-Ray-Hare Test
Hypothesis TestingA non-parametric extension of the Kruskal-Wallis test to two-factor designs, serving as the rank-based alternative to two-way ANOVA.
When to Use
Use this test when you have two categorical factors and a continuous or ordinal outcome but cannot assume normality. For example, testing the effects of treatment type and sex on a non-normally distributed pain score.
Assumptions
- Observations are independent.
- The dependent variable is at least ordinal.
- No strong interaction effect is present (the test has low power for detecting interactions).
Required Inputs
| Input | Type | Notes |
|---|---|---|
| Values | Numeric | Response variable (continuous or ordinal) |
| Factor 1 | Categorical | First grouping factor |
| Factor 2 | Categorical | Second grouping factor |
Output Metrics
| Metric | What it means |
|---|---|
| Factor A — DF | Degrees of freedom for the first factor. |
| Factor A — SS (Ranks) | Sum of squares of ranks for the first factor. |
| Factor A — H (Chi-Square) | H statistic for the first factor, approximated by chi-square. |
| Factor A — Pr > Chi-Square | P-value for the first factor. |
| Factor B — DF | Degrees of freedom for the second factor. |
| Factor B — SS (Ranks) | Sum of squares of ranks for the second factor. |
| Factor B — H (Chi-Square) | H statistic for the second factor. |
| Factor B — Pr > Chi-Square | P-value for the second factor. |
| A*B — H (Chi-Square) | H statistic for the interaction. |
| A*B — Pr > Chi-Square | P-value for the interaction effect. |
| N | Number of observations in each cell. |
| Median | Median of each cell. |
| Q1 | First quartile of each cell. |
| Q3 | Third quartile of each cell. |
| IQR | Interquartile range of each cell. |
| Mean Rank | Average rank within each cell. |
Interpretation
- Interpret the H statistics as you would F-statistics from two-way ANOVA, but based on ranks instead of raw values.
- A significant main effect means that the ranks differ across levels of that factor.
- The interaction test has relatively low statistical power. A non-significant interaction does not necessarily mean there is no interaction.
- Cell-level medians and mean ranks provide descriptive context for the test results.
Common Pitfalls
- The Scheirer-Ray-Hare test has notoriously low power for detecting interaction effects. If the interaction is your primary interest, consider aligned rank transform (ART) ANOVA instead.
- The chi-square approximation for the H statistic requires reasonable cell sizes. Very small cells produce unreliable p-values.
- This test does not have a well-established post-hoc procedure. Separate Mann-Whitney tests with Bonferroni correction are sometimes used as a follow-up.
How It Works
- Rank all observations across the entire dataset from smallest to largest.
- Perform a standard two-way ANOVA on the ranked data instead of the original values.
- Compute H statistics by dividing each sum of squares of ranks by the total mean square of ranks. Each H follows a chi-square distribution under the null hypothesis.
Citations
References
- Scheirer, C. J., Ray, W. S., & Hare, N. (1976). The analysis of ranked data derived from completely randomized factorial designs. Biometrics, 32(2), 429-434.