NAG CL Interface
g08aac performs the Sign test on two related samples of size .
||g08aac (Integer n,
const double x,
const double y,
The function may be called by the names: g08aac, nag_nonpar_test_sign or nag_sign_test.
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).
(a)the test statistic , which is the number of pairs for which ;
(b)the number of non-tied pairs ;
(c)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
is true; typically
is a small quantity such as
). The returned value of
can be used to perform a significance test on the median difference, against various alternative hypotheses
, as follows
(i): median of median of . is rejected if .
(ii): median of median of . is rejected if .
(iii): median of median of . is rejected if .
Siegel S (1956) Non-parametric Statistics for the Behavioral Sciences McGraw–Hill
On entry: , the size of each sample.
– const double
– const double
On entry: and must be set to the th pair of data values, , for .
– Integer *
On exit: the Sign test statistic, .
– double *
On exit: the lower tail probability, , corresponding to .
– Integer *
On exit: the number of non-tied pairs, .
– NagError *
The NAG error argument (see Section 7
in the Introduction to the NAG Library CL Interface).
Error Indicators and Warnings
Dynamic memory allocation failed.
See Section 3.1.2
in the Introduction to the NAG Library CL Interface for further information.
On entry, .
The tail probability,
, is computed using the relationship between the binomial and beta distributions. For
should be accurate to at least
significant figures, assuming that the machine has a precision of
or more digits. For
should be computed with an absolute error of less than
. For further details see g01eec
Parallelism and Performance
g08aac is not threaded in any implementation.
The time taken by g08aac is small, and increases with .
This example is taken from page 69 of Siegel (1956)
. The data relates to ratings of ‘insight into paternal discipline’ for
sets of parents, recorded on a scale from