 Dataplot Vol 1 Vol 2

# 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: $$\mu_1 = \mu_2$$ Ha: $$\mu_1 \ne \mu_2$$ Test Statistic: W=MIN(W-,W+) where the computation of W- and W+ is discussed above. Significance Level: $$\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 $$\mu_w = n(n+1)/4$$ and a standard deviation of $$\sigma_w = \sqrt{n(n+1)(2n+1)/24}$$ The critical regions are thus based on the normal percent point function. That is, for a 2-sided test, $$\mu_w - \sigma_w \phi^{-1}(\alpha/2) < W < \mu_w + \sigma_w \phi^{-1}(\alpha/2)$$ where $$\mu_w$$ and $$\sigma_w$$ are the mean and standard deviation of W as described above and $$\Phi^{-1}$$ 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.
Note:
From Conover, the signed rank test is based on the following assumptions:

1. The distribution of each di is symmetric.

2. The di are mutually independent.

3. The di all have the same mean.

4. The measurement scale of the di's is at least interval.

So the signed rank test weakens the assumption of normality of the paired t-test to an assumption of symmetry. The signed rank test is more powerful than a sign test (it takes the magnitude of the differences into account as well as the sign), but it has stronger assumptions than the sign test. So if your data is at approximately symmetric, then the signed rank test is preferred to the sign test. However, if the symmetry assumption is not reasonable, the sign test is preferred.

Also according to Conover, the null hypothesis can be stated either in terms of the mean or the median. This is due to the assumption of symmetry.

Note:
The following statistics are also supported:

LET A = ONE SAMPLE WILCOXON SIGNED RANK TEST Y
LET A = ONE SAMPLE WILCOXON SIGNED RANK TEST CDF Y
LET A = ONE SAMPLE WILCOXON SIGNED RANK TEST PVALUE Y
LET A = ONE SAMPLE WILCOXON SIGNED RANK TEST LOWER ...
TAIL PVALUE Y
LET A = ONE SAMPLE WILCOXON SIGNED RANK TEST UPPER ...
TAIL PVALUE Y

LET A = TWO SAMPLE WILCOXON SIGNED RANK TEST Y1 Y2
LET A = TWO SAMPLE WILCOXON SIGNED RANK TEST CDF Y1 Y2
LET A = TWO SAMPLE WILCOXON SIGNED RANK TEST PVALUE ...
Y1 Y2
LET A = TWO SAMPLE WILCOXON SIGNED RANK TEST LOWER ...
TAIL PVALUE Y1 Y2
LET A = TWO SAMPLE WILCOXON SIGNED RANK TEST UPPER ...
TAIL PVALUE Y1 Y2

In addition to the above LET command, built-in statistics are supported for about 20+ different commands (enter HELP STATISTICS for details).

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. RANK SUM TEST = Compute a rank sum 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.
References:
Conover (1999), "Practical Non-Parametric Statistics," Third Edition, Wiley, pp. 352-364.

Snedecor and Cochran (1989), "Statistical Methods," Eigth Edition, Iowa State University Press, pp. 140-142.

Applications:
Confirmatory Data Analysis
Implementation Date:
1999/5
2011/05: Switch algorithm to that given in Conover.
Program:

SKIP 25
SET WRITE DECIMALS 4
SIGNED RANK TEST Y1 Y2

The following output is generated.

Two Sample Two-Sided Wilcoxon Signed Rank Test
(Conover Formulation)

First Response Variable: Y1
Second Response Variable: Y2

H0: Mu1 - Mu2 Equal                              0.0000
Ha: Mu1 - Mu2 Not Equal                          0.0000

Summary Statistics:
Number of Observations:                              10
Number of Zero Differences (Omitted):                 3
Number of Positive Differences:                       3
Number of Negative Differences:                       4
Number of Tied Ranks:                                 2
Sum of Positive Ranks:                          13.5000
Sum of Negative Ranks:                          14.5000

Test (Large Sample Approximation):
Test Statistic Value:                           -0.0853
CDF Value:                                       0.4660
P-Value (2-tailed test):                         1.0000
P-Value (lower-tailed test):                     0.5000
P-Value (upper-tailed test):                     0.5677

Two-Tailed Test: Normal Approximation

H0: u1 - u2 = d0; Ha: u1 - u2 <> d0
------------------------------------------------------------
Null
Significance           Test       Critical     Hypothesis
Level      Statistic    Value (+/-)     Conclusion
------------------------------------------------------------
60.0%        -0.0853         0.8416         ACCEPT
80.0%        -0.0853         1.2816         ACCEPT
90.0%        -0.0853         1.6449         ACCEPT
95.0%        -0.0853         1.9600         ACCEPT
99.0%        -0.0853         2.5758         ACCEPT


NIST is an agency of the U.S. Commerce Department.

Date created: 06/05/2001
Last updated: 02/10/2015