Wilcoxon signed-rank test
H=nan_signrank (x, y) H=nan_signrank (x, y, alpha) H=nan_signrank (x, y, alpha,tail) [h,pval, stats] = nan_signrank(..)
input vector
input vector
significance level (default alpha = 0.05)
returns whether the Null-Hypotheses must be rejected.
p-value of the test
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 @var{z} approximately follows a standard normal distribution when n > 5.
@strong{Warning}: This function assumes a normal distribution for z and thus is invalid for n < 5.
With the optional argument string tail, the alternative of interest can be selected. If tail 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.
Xa=[78,24,64,45,64,52,30,50,64,50,78,22,84,40,90,72]; Xb=[78,24,62,48,68,56,25,44,56,40,68,36,68,20,58,32]; Y1= [81.0 105.4 119.7 109.7 98.3 146.6 142.0 150.7 191.5 145.7 82.3 77.3 78.4 131.3 89.6 119.8 121.4 124.0 140.8 124.8 98.9 89.0 69.1 89.3 104.1 86.9 77.1 78.9 101.8 96.0]; Y2 = [80.7 82.3 80.4 87.2 84.2 100.4 115.5 112.2 147.7 108.1 103.1 105.1 116.5 139.9 129.6 98.9 61.9 96.2 125.5 75.7 66.4 49.9 96.7 61.9 80.3 67.7 66.7 67.4 91.8 94.1];