% -*- texinfo -*- % @deftypefn {Function File} {[@var{pval}, @var{b}, @var{n}] =} sign_test (@var{x}, @var{y}, @var{alt}) % For two matched-pair samples @var{x} and @var{y}, perform a sign test % of the null hypothesis PROB (@var{x} > @var{y}) == PROB (@var{x} < % @var{y}) == 1/2. Under the null, the test statistic @var{b} roughly % follows a binomial distribution with parameters @code{@var{n} = sum % (@var{x} ~= @var{y})} and @var{p} = 1/2. % % With the optional argument @code{alt}, the alternative of interest % can be selected. If @var{alt} is @code{'~='} or @code{'<>'}, the % null hypothesis is tested against the two-sided alternative PROB % (@var{x} < @var{y}) ~= 1/2. If @var{alt} is @code{'>'}, the % one-sided alternative PROB (@var{x} > @var{y}) > 1/2 ('x is % stochastically greater than y') is considered. Similarly for % @code{'<'}, the one-sided alternative PROB (@var{x} > @var{y}) < 1/2 % ('x is stochastically less than y') is considered. The default is % the two-sided case. % % The p-value of the test is returned in @var{pval}. % % If no output argument is given, the p-value of the test is displayed. % @end deftypefn