image thumbnail

Automated unpaired 2 sample statsitical test

version 1.0.7 (19.8 KB) by Nirvik Sinha
An automated interface to computation of one-sided/two-sided p-value using appropriate unpaired 2-sample parametric / non-parametric tests.


Updated 22 Jul 2020

View License

1. The Mann-Whitney U test (which is often used as a non-parametric alternative to independent sample t-test) ha a high false positive rate when the two samples have unequal higher order moments (e.g. unequal variance) [1]. Fligner and Pollicello's robust rank order test corrects this short-coming [2].
2. However, when the sample distributions cannot be assumed to be normal, they are often fallaciously assumed to be at least symmetric which is rarely the case. In fact in such cases, the absolute performance of both the above non-parametric tests is poor. Additionally, the convergence of the test statistic to standard normal distribution is often slow (as the sample sizes increase) [2,3].
3. Hence, this function adopts a boot-strapped Monte-Carlo method to dynamically approximate the critical values for the test statistic of the non-parametric tests. This technique has the advantage of making no assumptions about data distributions and therefore significantly reduce the bias in these tests [3].
4. This function requires Statistics and Machine Learning Toolbox
5. Written and tested in MATLAB R2020a

LIMITATIONS : 1. This function is only valid for continuous data.

1.Fligner, M.A. and Pollicello, G.E. III. (1981). “Robust Rank Procedures for the Behrens-Fisher Problem.” Journal of the American Statistical Association. 76, 162–168.
2. Feltovich, N. Nonparametric Tests of Differences in Medians: Comparison of the Wilcoxon–Mann–Whitney and Robust Rank-Order Tests. Experimental Economics 6, 273–297 (2003).
3. Boos, D.D. and Brownie, C. (1988). “Bootstrap p-Values for Tests of Nonparametric Hypotheses.” Institute of Statistics Mimeo Series No. 1919, North Carolina State University.

Cite As

Nirvik Sinha (2022). Automated unpaired 2 sample statsitical test (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2020a
Compatible with R2018b and later releases
Platform Compatibility
Windows macOS Linux

Inspired by: fitmethis

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!