SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Contacts SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Auxiliary Chapter

SIGNED RANK TEST

Name:
    SIGNED RANK TEST
Type:
    Analysis Command
Purpose:
    Perform a one sample or a paired two sample signed rank test.
Description:
    The t-test is the standard test for testing that the difference between population means for two paired samples are equal. If the populations are non-normal, particularly for small samples, then the t-test may not be valid. The signed rank test is an alternative that can be applied when distributional assumptions are suspect. However, it is not as powerful as the t-test when the distributional assumptions are in fact valid.

    The signed rank test is also commonly called the Wilcoxon signed rank test or simply the Wilcoxon test.

    To form the signed rank test, compute di = Xi - Yi where X and Y are the two samples. Rank the di without regard to sign. Tied values are not included in the Wilcoxon test. After ranking, restore the sign (plus or minus) to the ranks. Then compute W+ and W- as the sums of the positive and negative ranks respectively. If the two population means are in fact equal, then the sums of the ranks should also be nearly equal. If the difference between the sum of the ranks is too great, we reject the null hypothesis that the population means are equal.

    Significance levels are based on the fact that if there is no difference in the population means, then there are 2n equally likely ways for the n ranks to recieve signs.

    More formally, the hypothesis test is defined as follows.

    H0: u1 = u2
    Ha: u1 <> u2
    Test Statistic: W=MIN(W-,W+) where the computation of W- and W+ is discussed above.
    Alpha: Typically set to .05. Due to the discreteness of the ranks, the actual significance level will not in most cases be exact.
    Critical Region: For small samples (N <= 30), the critical regions have been tabulated. For N > 30, the test statistic W approaches a normal distribution with a mean of

      N(N+1)/4

    and a standard deviation of

      SQRT[N(N+1)(2*N+1)/24].

    The critical regions are thus based on the normal percent point function. That is, for a 2-sided test,

      Uw - Sw*NORPPF(ALPHA/2) < W < Uw + Sw*NORPPF(1-ALPHA/2)

    where Uw and Us are the mean and standard deviation of W as described above and NORPPF is the normal percent point function.

    Conclusion: Reject null hypothesis if test statistic is in critical region

    Although the above discussion was in terms of a paired two sample test, it can easily be adapted to the following additional cases:

    1. For the one sample case that the population mean is equal to a value d0, simply compute di = xi - d0 and calculate W+ and W- based on di.

    2. For the paired two sample case where we want to test that the difference between the two population means is equal to d0, compute di = xi - yi - d0 and calculate W+ and W- based on di.
Syntax 1:
    SIGNED RANK TEST <y1> <mu>             <SUBSET/EXCEPT/FOR qualification>
    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 signed rank test.

Syntax 2:
    SIGNED RANK TEST <y1> <y2>             <SUBSET/EXCEPT/FOR qualification>
    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 signed rank test where the hypothesized difference between the population means for the two samples is zero.

Syntax 3:
    SIGNED RANK TEST <y1> <y2> <mu>
                            <SUBSET/EXCEPT/FOR qualification>
    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.

    This syntax implements the two sample paired signed rank test where the hypothesized difference between the population means for the two samples is equal to a non-zero value.

Examples:
    SIGNED RANK TEST Y1 0
    SIGNED RANK TEST Y1 Y2
    SIGNED RANK TEST Y1 Y2 MU
    SIGNED RANK TEST Y1 Y2 SUBSET TAG > 2
Note:
    DATAPLOT automatically prints the test statistic for both one sided and two sided tests.
Note:
    Dataplot saves the following internal parameters after a sign test:

      STATVAL = W, i.e., the minimum of the signed ranks
      STATCD2 = the normal cdf value of W
      CUTLOW90 = 0.05 critical value
      CUTUPP90 = 0.95 critical value
      CUTLOW95 = 0.025 critical value
      CUTUPP95 = 0.975 critical value
      CUTLOW99 = 0.005 critical value
      CUTUPP99 = 0.995 critical value

    Note that the above critical values are the lower and upper tails for two sided tests (i.e., each tail is alpha/2. For example, CUTLOW90 is the lower 5% of the normal percent point function (adjusted for the mean and standard deviation). This is the critical regions for alpha = 0.10, so there is 0.05 in each tail.

Note:
    The sign test is also an alternative to the t test for paired samples when the normality assumption is in doubt. The signed rank test is generally preferred over the sign test because it takes into account both the sign of the difference and the magnitude of the difference for paired samples while the sign test only takes the difference of the sign into account.
Default:
    None
Synonyms:
    The following are synonyms for SIGNED RANK TEST:

      WILCOXON SIGNED RANK TEST
      WILCOXON SIGNED RANK
      WILCOXON SIGN TEST
      WILCOXON TEST
      SIGNED RANK
Related Commands:
    T-TEST = Compute a t-test.
    SIGN TEST = Compute a sign test.
    CHI-SQUARED 2 SAMPLE TEST = Compute a two sample chi-square test.
    BIHISTOGRAM = Generates a bihistogram.
    QUANTILE-QUANTILE PLOT = Generate a quantile-quantile plot.
    BOX PLOT = Generates a box plot.
Reference:
    "Statistical Methods", Eigth Edition, Snedecor and Cochran, 1989, Iowa State University Press, pp. 140-142.
Applications:
    Confirmatory Data Analysis
Implementation Date:
    1999/5
Program:
    SKIP 25
    READ NATR332.DAT Y1 Y2
    SIGNED RANK TEST Y1 Y2

    The following output is generated.

     
        
                     WILCOXON SIGNED RANK TEST
                        (PAIRED 2-SAMPLE)
    HYPOTHESIS BEING TESTING--POPULATION MEANS MU1 = MU2
    SAMPLE SIZE                             =       10
    NUMBER OF NON-ZERO DIFFERENCES          =        7
    SUM OF POSITIVE RANKS (W+)              =    13.50000
    SUM OF NEGATIVE RANKS (W-)              =    14.50000
    WILCOXON SIGNED RANK TEST STATITIC (W)  =    13.50000
     
    HYPOTHESIS     ACCEPTANCE INTERVAL      CONCLUSION
    MU1 < MU2      W- >    4.000000         ACCEPT
    MU1 = MU2      W  >    2.000000         ACCEPT
    MU1 > MU2      W+ >    4.000000         ACCEPT
        

Date created: 6/5/2001
Last updated: 4/4/2003
Please email comments on this WWW page to alan.heckert@nist.gov.