# naginterfaces.library.nonpar.test_​sign¶

naginterfaces.library.nonpar.test_sign(x, y)[source]

test_sign performs the Sign test on two related samples of size .

For full information please refer to the NAG Library document for g08aa

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/g08/g08aaf.html

Parameters
xfloat, array-like, shape

and must be set to the th pair of data values, , for .

yfloat, array-like, shape

and must be set to the th pair of data values, , for .

Returns
isgnint

The Sign test statistic, .

n1int

The number of non-tied pairs, .

pfloat

The lower tail probability, , corresponding to .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, the samples are identical, i.e., .

Notes

The Sign test investigates the median difference between pairs of scores from two matched samples of size , denoted by , for . The hypothesis under test, , often called the null hypothesis, is that the medians are the same, and this is to be tested against a one - or two-sided alternative (see below).

test_sign computes:

1. the test statistic , which is the number of pairs for which ;

2. the number of non-tied pairs ;

3. the lower tail probability corresponding to (adjusted to allow the complement to be used in an upper one tailed or a two tailed test). is the probability of observing a value if , or of observing a value if , given that is true. If , is set to .

Suppose that a significance test of a chosen size is to be performed (i.e., is the probability of rejecting when is true; typically is a small quantity such as or ). The returned value of can be used to perform a significance test on the median difference, against various alternative hypotheses , as follows

1. : median of median of . is rejected if .

2. : median of median of . is rejected if .

3. : median of median of . is rejected if .

References

Siegel, S, 1956, Non-parametric Statistics for the Behavioral Sciences, McGraw–Hill