Non-parametric alternative of 2-way ANOVA (ScheirerRayHare)
Version 1.0.1 (1.58 KB) by
Nirvik Sinha
This is a simplified MATLAB implementation of R's Scheirer-Ray-Hare test
For more details refer to: James Scheirer, William S. Ray, Nathan Hare, The Analysis of Ranked Data Derived from Completely Randomized Factorial Designs. In: Biometrics. 32(2)/1976. International Biometric Society, S. 429–434
% Example from Sokal and Rohlf, 1995:
Value = [709,679,699,657,594,677,592,538,476,508,505,539];
Sex = [1 1 1 2 2 2 1 1 1 2 2 2]; % 1 -> Male, 2 -> Female
Fat = [1 1 1 1 1 1 2 2 2 2 2 2]; % 1 -> Fresh, 2-> Rancid
Data = [Value',Sex',Fat'];
out = SRH_test(Data,'Sex','Fat')
4×5 table
Factor SS DF H pvalue
_____________ ______ __ _______ _________
{'Sex' } 8.3333 1 0.64103 0.42334
{'Fat' } 108 1 8.3077 0.0039478
{'Sex x Fat'} 5.3333 1 0.41026 0.52184
{'Residuals'} 21.333 8 NaN NaN
Cite As
Nirvik Sinha (2024). Non-parametric alternative of 2-way ANOVA (ScheirerRayHare) (https://www.mathworks.com/matlabcentral/fileexchange/96399-non-parametric-alternative-of-2-way-anova-scheirerrayhare), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2021a
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.