Sign test
H = nan_signtest (x, y) H = nan_signtest (x, y,alpha) H = nan_signtest (x, y,alpha,tail) [H,pval,stats] = nan_signtest(...)
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 samples x and @y, perform a sign test of the null hypothesis PROB (x > y) == PROB (x < y) == 1/2. Under the null, the test statistic b roughly follows a binomial distribution with parameters n = sum (x!= y) and p = 1/2.
With the optional argument tail, the alternative of interest can be selected. If tail is "~=" or "<>", the null hypothesis is tested against the two-sided alternative PROB (x < y) ~= 1/2. If tail is ">", the one-sided alternative PROB (x > y) > 1/2 ("x is stochastically greater than y") is considered. Similarly for "<", the one-sided alternative PROB (x > y) < 1/2 ("x is stochastically less than y") is considered. The default is the two-sided case.
before=[5 3 4 2 1 6 7 3 2 3 5 1 4 4 3]; after =[6 2 4 4 3 6 7 5 3 5 5 3 4 5 2]; nan_signtest(before,after,0.05,"<")