Navigation

Operators and Keywords

Function List:

C++ API

: [pval, z] = wilcoxon_test (x, y, alt)

For two matched-pair sample vectors x and y, perform a Wilcoxon signed-rank test of the null hypothesis PROB (x > y) == 1/2.

Under the null, the test statistic z approximately follows a standard normal distribution when n > 25.

Caution: This function assumes a normal distribution for z and thus is invalid for n ≤ 25.

With the optional argument string alt, the alternative of interest can be selected. If alt is "!=" or "<>", the null is tested against the two-sided alternative PROB (x > y) != 1/2. If alt is ">", the one-sided alternative PROB (x > y) > 1/2 is considered. Similarly for "<", the one-sided alternative PROB (x > y) < 1/2 is considered. The default is the two-sided case.

The p-value of the test is returned in pval.

If no output argument is given, the p-value of the test is displayed.

Package: octave