AI Glossary / Statistics and probability / Advanced
Scheirer - Ray - Hare test
Definition
The Scheirer - Ray - Hare test is a rank-based procedure for examining two factors and their interaction in an independent-observations factorial design. It extends the logic of the Kruskal - Wallis test to a two-factor setting, using pooled ranks and approximate chi-square reference distributions.
What it means
Suppose an evaluation varies both a workflow and a training condition. A one-factor analysis would overlook part of that design. This procedure asks about the two factors and whether their effects interact, without requiring normally distributed raw measurements.
Ranking does not remove every assumption or make all interpretations about medians valid. Differences in distribution shapes can matter. A statistical interaction on ranks also need not match an interaction on the original measurement scale.
How it works
Pool the observations and assign ranks, averaging ranks for ties. Fit the factorial decomposition to those ranks and obtain sums of squares for each factor and their interaction.
In the rcompanion implementation, each effect's sum of squares is divided by N(N + 1)/12. A correction adjusts for tied rank groups. The resulting H statistic is compared with an approximate chi-square distribution using that effect's degrees of freedom.
This is not simply an ordinary analysis-of-variance F test applied to ranks: the denominator and reference distribution differ. In unbalanced designs, the choice of sums of squares also matters. Identify the implementation and settings rather than relying only on the test name.
Three practical examples
1. Workflow study: compare completion scores across two workflows and two training conditions, with different participants in every cell.
2. AI evaluation: examine two interface designs and two explanation formats using independent task assignments. If the same people or tasks recur, a method representing that dependence is needed.
3. Service experiment: study ordinal satisfaction across routing and onboarding conditions. Check whether a rank-based factorial question fits the intended interpretation and the experimental design.
Think of it this way
Imagine replacing measured values with finishing positions, then examining how those positions vary across a two-way table. The table retains the factorial structure, but the distance between first and second place does not preserve the original measurement gap.
Worked example
Construct a fictional balanced experiment with factors A and B, each having two levels. Each of the four cells contains five independent observations. For transparent arithmetic, let the twenty observations be the integers one through twenty, with no ties.
At A1,B1 use 1,2,3,4,5. At A1,B2 use 6,7,8,9,10. At A2,B1 use 11,12,13,14,15. At A2,B2 use 16,17,18,19,20. The pooled ranks equal these numbers.
The cell mean ranks are 3,8,13 and 18. Factor A's mean ranks are 5.5 and 15.5; factor B's are 8 and 13. The overall mean rank is 10.5.
For A, the sum of squares is 10[(5.5 - 10.5)^2 + (15.5 - 10.5)^2] = 500. For B it is 10[(8 - 10.5)^2 + (13 - 10.5)^2] = 125.
Each cell mean equals its row mean plus its column mean minus the overall mean. Therefore, the interaction sum of squares is zero. The within-cell sum of squares is forty, and the total is 500 + 125 + 0 + 40 = 665.
With N = 20, the rank variance denominator is 20 × 21/12 = 35. There are no ties, so the tie correction is one. The H statistics are consequently 500/35 = 14.2857 for A, 125/35 = 3.5714 for B, and zero for the interaction.
Each effect has one degree of freedom. Approximate chi-square upper-tail probabilities are 0.000157, 0.05878 and 1, respectively. At an unadjusted five-percent threshold for each test, A crosses the threshold; B and the interaction do not. These three decisions do not themselves constitute a familywise multiplicity adjustment.
The example deliberately creates additive cell mean ranks. The interaction result does not prove that real processes never interact, and B's result does not establish equivalence between its levels. Five observations per cell make the arithmetic compact; that sample size is not a universal assurance of accurate approximation or adequate power.
Illustrative case study
Fictional Willow Evaluation uses the worked table to rehearse its reporting process. An initial report says that training has no effect because the B result is above five percent.
The reviewer changes this to a statement that the specified procedure did not establish a B effect at that threshold. The team also reports cell summaries and the rank-scale question. Before collecting real data, it checks independence, plans the comparisons and considers whether another factorial method better answers its operational question. This is an invented teaching case, not evidence about a real training program.
Common misconceptions and mistakes
“Nonparametric means assumption-free.” Independence and a suitable design remain essential.
“It is the usual F test on ranks.” The H denominator and chi-square reference differ.
“No significant interaction means no interaction exists.” Limited information or sensitivity can prevent detection.
“Every rank test compares medians.” Distributional differences require more careful interpretation, particularly when group shapes differ.
Business use
Define the factors, response and independent observational unit before selecting the procedure. Preserve cell counts, missing-data decisions and tie information. If repeated evaluations share a person, customer or task, account for that structure.
Compare the question with alternatives such as aligned rank procedures or an appropriate response model. Do not choose whichever method yields the smallest probability. For automated reporting, verify the implementation, sums-of-squares convention, approximation and interpretation of each effect. Include descriptive results and operational relevance alongside significance decisions.
People also ask
Can it use ordinal responses?
Yes, provided ranking and the design are appropriate; ties require attention.
Does it automatically handle repeated measures?
No; the independent-observations formulation does not model that dependence.
Does a main-effect result identify every differing pair?
No; any follow-up comparisons need their own justified analysis.
Check your understanding
Why is the denominator thirty-five?
Answer: It is N(N + 1)/12 with twenty observations.
Why is the interaction sum of squares zero here?
Answer: The four cell mean ranks fit an additive row-plus-column pattern exactly.
Why is the B result not evidence of equivalence?
Answer: Failure to reject a difference is not an equivalence analysis.
Related terms
- Factorial design
- Rank
- Sums of squares
- Kruskal–Wallis test
- interaction
- ties
- chi-square distribution
- aligned rank transform
Learn next
Replace two observations with tied values. Recompute pooled average ranks and inspect how the tie correction changes the calculation before interpreting the result.
More in Statistics and probability
- Scales of measurement - Scales of measurement describe the relationships represented by values assigned to observations.
- Scatterplot smoothing - Scatterplot smoothing estimates a curve through paired observations to describe how a response tends to vary with a predictor.
- Scheffé test - The Scheffé test is a multiple-comparison procedure for examining contrasts among population means in an analysis-of-variance framework.
- Scientific protocol - A scientific protocol is a documented plan describing how a study or experiment will be carried out.
- Score test - A score test is a likelihood-based hypothesis test that evaluates the slope of the log-likelihood at parameter values satisfying the null hypothesis.
- Seasonal subseries plot - A seasonal subseries plot is a time-series display that groups observations by their position within a recurring cycle, while retaining chronological order...
Sources
Salvatore S. Mangiafico, rcompanion reference documentation, scheirerRayHare: https://search.r-project.org/CRAN/refmans/rcompanion/html/scheirerRayHare.html
Salvatore S. Mangiafico, R Companion handbook, Scheirer–Ray–Hare Test: https://rcompanion.org/handbook/F_14.html
rcompanion primary implementation, rank decomposition and H statistic: https://rdrr.io/cran/rcompanion/src/R/scheirerRayHare.r
Previous: Scheffé test Next: Schema