Click or drag to resize
WilcoxonRankSum Class
Performs a Wilcoxon rank sum test.
Inheritance Hierarchy
SystemObject
  Imsl.StatWilcoxonRankSum

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class WilcoxonRankSum

The WilcoxonRankSum type exposes the following members.

Constructors
  NameDescription
Public methodWilcoxonRankSum
Constructor for WilcoxonRankSum.
Top
Methods
  NameDescription
Public methodCompute
Performs a Wilcoxon rank sum test.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetStatistics
Returns the statistics. Note that the Compute method must be invoked first before invoking this method. Otherwise, the method throws a NullReferenceException exception.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetFuzz
Sets the nonnegative constant used to determine ties in computing ranks in the combined samples.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

Class WilcoxonRankSum performs the Wilcoxon rank sum test for identical population distribution functions. The Wilcoxon test is a linear transformation of the Mann-Whitney U test. If the difference between the two populations can be attributed solely to a difference in location, then the Wilcoxon test becomes a test of equality of the population means (or medians) and is the nonparametric equivalent of the two-sample t-test. Class WilcoxonRankSum obtains ranks in the combined sample after first eliminating missing values from the data. The rank sum statistic is then computed as the sum of the ranks in the x sample. Three methods for handling ties are used. (A tie is counted when two observations are within fuzz of each other.) Method 1 uses the largest possible rank for tied observations in the smallest sample, while Method 2 uses the smallest possible rank for these observations. Thus, the range of possible rank sums is obtained.

Method 3 for handling tied observations between samples uses the average rank of the tied observations. Asymptotic standard normal scores are computed for the W score (based on a variance that has been adjusted for ties) when average ranks are used (see Conover 1980, p. 217), and the probability associated with the two-sided alternative is computed.

Hypothesis Tests

In each of the following tests, the first line gives the hypothesis (and its alternative) under the assumptions 1 to 3 below, while the second line gives the hypothesis when assumption 4 is also true. The rejection region is the same for both hypotheses and is given in terms of Method 3 for handling ties. If another method for handling ties is desired, another output statistic, stat[0] or stat[3], should be used, where stat is the array containing the statistics returned from the getStatistics method.

TestNull HypothesisAlternative HypothesisAction
1\begin{array}{l} H_0:{\rm Pr}(x1\lt x2)=0.5 \\ 
                H_0:E(x1)=E(x2) \end{array}\begin{array}{l} H_1:{\rm Pr}(x1\lt x2)\neq 0.5 
                \\H_1:E(x1)\neq E(x2) \end{array}Reject if stat[9] is less than the significance level of the test. Alternatively, reject the null hypothesis if stat[6] is too large or too small.
2\begin{array}{l} H_0:{\rm Pr}(x1\lt x2)\leq 0.5 \\ 
                H_0:E(x1)\geq E(x2) \end{array}\begin{array}{l} H_1:{\rm Pr}(x1\lt x2)\neq0.5 
                \\H_1:E(x1)\lt E(x2) \end{array}Reject if stat[6] is too small
3\begin{array}{l} H_0:{\rm Pr}(x1\lt x2)\geq 0.5 \\ 
                H_0:E(x1)\leq E(x2) \end{array}\begin{array}{l} H_1:{\rm Pr}(x1\lt x2)\lt 0.5 
                \\H_1:E(x1)\gt E(x2) \end{array}Reject if stat[6] is too large

Assumptions

  1. x and y contain random samples from their respective populations.
  2. All observations are mutually independent.
  3. The measurement scale is at least ordinal (i.e., an ordering less than, greater than, or equal to exists among the observations).
  4. If f(x) and g(y) are the distribution functions of x and y, then g(y) = f(x + c) for some constant c(i.e., the distribution of y is, at worst, a translation of the distribution of x).

Tables of critical values of the W statistic are given in the references for small samples.

See Also