Home > freetb4matlab > statistics > tests > sign_test.m

sign_test

PURPOSE ^

% For two matched-pair samples @var{x} and @var{y}, perform a sign test

SYNOPSIS ^

function [pval, b, n] = sign_test (x, y, alt)

DESCRIPTION ^

% -*- 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003