
SIGN TESTName:
To form the sign test, compute d_{i} = X_{i}  Y_{i} where X and Y are the two samples. Count the number of times d_{i} is positive, R+, and the number of times it is negative, R. If the samples have equal medians and the populations are symmetric, then R+ and R should be similar. If there are too many positives (R+) or negatives (R), then we reject the hypothesis of equality. Ties are excluded from the analysis. Since there are only two choices (+ or ) for d_{i} the test statistic for the sign test follows a binomial distribution with p=0.5. Note that the binonial distribution is discrete, so the significance level will typically not be exact. More formally, the hypothesis test is defined as follows.
Although the above discussion was in terms of a paired two sample test, it can easily be adapted to the following additional cases:
where <y1> is a response variable; <mu> is a number or parameter that is the hypothesized mean value; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax implements the one sample sign test.
where <y1> is the first response variable; <y2> is the second response variable; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax implements the two sample paired sign test where the hypothesized difference between the population means for the two samples is zero.
where <y1> is the first response variable; <y2> is the second response variable; <mu> is a number or parameter that is the hypothesized difference between the means of the two samples; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
SIGN TEST Y1 Y2 SIGN TEST Y1 Y2 MU SIGN TEST Y1 Y2 SUBSET TAG > 2 This syntax implements the two sample paired sign test where the hypothesized difference between the population means for the two samples is not equal to zero.
STATVALM = R, i.e., the number of minus signs STATVALP = S+, i.e., BINCDF(R+,0.5,N) STATVALM = S, i.e., BINCDF(R,0.5,N) CUTLOW90 = BINPPF(0.05,0.5,N) CUTUPP90 = BINPPF(0.95,0.5,N) CUTLOW95 = BINPPF(0.025,0.5,N) CUTUPP95 = BINPPF(0.975,0.5,N) CUTLOW99 = BINPPF(0.005,0.5,N) CUTUPP99 = BINPPF(0.995,0.5,N)
2000/8: bug fix for 2sided interval. Was actually calculating a 90% interval rather than a 95% interval.
READ NATR332.DAT Y1 Y2 SIGN TEST Y1 Y2 The following output was generated. TWO SAMPLE (PAIRED) SIGN TEST H0: TWO POPULATION MEDIANS ARE EQUAL SAMPLE SIZE = 10 NUMBER OF POSITIVE DIFFERENCES = 3 NUMBER OF NEGATIVE DIFFERENCES = 4 SIGN TEST STATISTIC CDF VALUE (R+) = 0.5000000 SIGN TEST STATISTIC CDF VALUE (R) = 0.7734375 ALTERNATIVE ALTERNATIVE ALTERNATIVE HYPOTHESIS HYPOTHESIS HYPOTHESIS ACCEPTANCE INTERVAL CONCLUSION MEDIAN1 <> MEDIAN2 R+: (0,0.025), R: (0,0.025) REJECT MEDIAN1 < MEDIAN2 (R+) (0,0.05) REJECT MEIDAN1 > MEDIAN2 (R) (0,0.05) REJECT
Date created: 6/5/2001 