The S_TEST function tests the hypothesis that two sample populations X and Y have the same mean of distribution against the hypothesis that they differ. The result is a two-element vector containing the maximum number of signed differences between corresponding pairs of xi and yi and its one-tailed significance. This type of test is often referred to as the " Sign Test."
This routine is written in the IDL language. Its source code can be found in the file
s_test.pro
in the
lib
subdirectory of the IDL distribution.
Define two n -element sample populations.
X = [47, 56, 54, 49, 36, 48, 51, 38, 61, 49, 56, 52]
Y = [71, 63, 45, 64, 50, 55, 42, 46, 53, 57, 75, 60]
Test the hypothesis that the two sample populations have the same mean of distribution against the hypothesis that they differ at the 0.05 significance level.
PRINT, S_TEST(X, Y, ZDIFF = zdiff)
The computed probability (0.0729981) is greater than the 0.05 significance level and therefore we do not reject the hypothesis that X and Y have the same mean of distribution.