Calculating the point estimate for ETA1 - ETA2, W, and the p-value for the Mann-Whitney test

Suppose the data for the first sample (Samp1) are 22, 24, 25, 29, 30 and the data for the second sample (Samp2) are 16, 21, 22, 23. The output from the Mann-Whitney test is:

Mann-Whitney: C1, C2

Method η₁: median of C1 η₂: median of C2 Difference: η₁ - η₂
Descriptive Statistics Sample N Median C1 5 25.0 C2 4 21.5
Estimation for Difference CI for Achieved Difference Difference Confidence 6 (-0.0000000, 13) 96.27%
Test Null hypothesis H₀: η₁ - η₂ = 0 Alternative hypothesis H₁: η₁ - η₂ ≠ 0
Method W-Value P-Value Not adjusted for ties 33.50 0.050 Adjusted for ties 33.50 0.049

Calculating the point estimate

The point estimate for η1 – η2 is the median of all possible pairwise differences between the two samples.

For this example, there are 5*4 = 20 pairwise differences. The possible pairwise differences for this example are: 22-16 = 6, 22-21 = 1, 22-22= 0, 22-23= −1, 8, 3, 2, 1, 9, 4, 3, 2, 13, 8, 7, 6, 14, 9, 8, 7.

Note

You can get all the pairwise differences between 2 columns in Minitab by choosing Stat > Nonparametrics > Pairwise Differences.

The median of these differences is 6.

Calculating W

W = (number of positive differences) + 0.5(number of differences that equal 0) + 0.5(n1(n1+1)) where n1 = number of observations in the first sample.

For this example, W = 18 + 0.5(1) + 0.5*5*6 = 18 + 0.5 + 15 = 33.5.

Calculating the p-value

The p-value is based on the test statistic for W. The test statistic, Z, (which is not part of the output) is a normal approximation using the mean and variance of W.

Mean of W = 0.5(n1 (n1 + n2 + 1)) variance of W = n1*n2(n1+n2+1)/12 where n1 and n2 are the number of observations in the first and second sample, respectively.

Z = (|W - mean of W| - .5)/square root of the variance of W.

Note

Subtracting the .5 from the numerator is the continuity correction factor.

The p-value for Ha: η1 < η2 is CDF(Z). The p-value for Ha: η1 > η2 is (1 - CDF(Z)). The p-value for Ha: η1 ≠ η2 is 2*(1 - CDF(Z)). Where CDF is the cumulative probability of a standard normal distribution.

For this example:
  • mean of W = 0.5*5(5+4+1) = 2.5*10 = 25
  • variance of W = 5*4(5+4+1)/12 = 20*10/12 = 200/12 = 16.6667

Z = (|33.5 - 25| - .5)/sqrt(16.6667) = 1.9596

The p-value for Ha: η1 ≠ η2 is 2*(1 - 0.974979.) = 0.05.

Note

You can get the cumulative probabilities in Minitab by choosing Calc > Probability Distributions > Normal.