<< nan_signrank Hypothesis Tests nan_ttest >>

NaN Toolbox >> NaN Toolbox > Hypothesis Tests > nan_signtest

nan_signtest

Sign test

Calling Sequence

H =  nan_signtest (x, y)
H =  nan_signtest (x, y,alpha)
H =  nan_signtest (x, y,alpha,tail)
[H,pval,stats] = nan_signtest(...)

Parameters

x:

input vector

y:

input vector

alpha:

significance level (default alpha = 0.05)

tail:

H:

returns whether the Null-Hypotheses must be rejected.

pval:

p-value of the test

Description

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.

Examples

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,"<")

Authors


<< nan_signrank Hypothesis Tests nan_ttest >>